Upgrade terraform from 0.15.0 to 1.0.0

I am doing upgrade from my current terrafrom version 0.15.5 ( very old ) to 1.0.0 .
during the upgrade encountered the issue :
Error: deleting EC2 Network ACL (acl-0bbe0520f6be44a7b) Entry: UnauthorizedOperation:

Steps followed during the upgrade :

  1. change the terraform from 0.15.5 to 1.0.0 .
  2. terraform init
  3. terraform plan
  4. terraform apply
    it’s failed to run the changes and error is like below

Error: deleting EC2 Network ACL (acl-0bbe0520f6be44a7b) Entry: UnauthorizedOperation:

it’s quite clear that permission is not correct but would like to know how to fix the issue with terraform itself ?

Snehil Belekar

It is very unlikely that this error is caused by upgrading Terraform. I strongly expect you would get the same error using your old (0.15.5) version of Terraform.

Since the error is from AWS, saying you are not authorized to perform the change you are trying to apply, you need to look at what identity you are using to authenticate to AWS and whether its permissions actually grant those rights.

No @maxb it works still as charm when i did the rollback to 0.15.5 again

Terraform v0.15.5 and v1.0.0 are the same release. The v0.15 branch was effectively a pre-release for v1.0, and when v0.15 proved stable (which was at v0.15.5), v1.0 was cut from that branch with no changes in the code.

A more likely scenario is that you have changed a provider version while upgrading.

Also note that not using the latest patch in a release series leaves you open to more confusion by being exposed to known bugs which were fixed with later patches.

it’s coming from the below module after upgrade from 3.19.0 to

source = “terraform-aws-modules/vpc/aws”
version = “4.0.1”

I added the versioning to check in more details and found out the issue rootcause. but how to fix that stays remain a question.

The module has a number of backwards incompatible changes listed between v3 and v4, along with upgrading the aws provider itself. Have you checked the upgrade guide to see if any of the changes apply to your use of the module?

It may not be enforced by the module, but given that 4.0.1 is a fairly recent release, it may help to be on a recent release of Terraform as well which is likely better tested by the module developers.

thanks, I think I am missing links for the upgrade guide, could you please guide me where can i found upgrade guides for the modules ?

It is necessary to follow the link from the Terraform Registry page advertising the module, to the module’s GitHub repository. Then you can find the upgrade guides as markdown documents in the Git repo.

The module author has not provided a direct link from the front page of the documentation, instead requiring users to go searching for the upgrade information.