-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terraform errors out on plan if defined NACL rule missing #2291
Comments
I'm having the same issue... |
Terraform Version
I believe I am experiencing the same problem. The result is that I can't renumber my rules to manage their order. I also can't destroy them so they are re-created unless I revert code, destroy and then apply the new code. Consequently, I can't upgrade my NACLs in production because I can't change them in place unless I build completely new ones and move subnets to those. Related? hashicorp/terraform#13608 Steps to Reproduce
I also tried tainting the NACL to force rebuild, but that fails because it can't delete the rules it can't find and throws straight to an error.
|
I'm having the same issue. my case is:
|
I have seen this exact error as per OP and I think it is due to network ACLs being stateless. They can't be processed in same way as other resources. Yes they do get their own rule id per NACL - but Terraform doesn't know the difference as to whether a rule removed or has reappeared as a different number (and thus different nacl rule id) is related or even the same. State can be instantly divergent once you make a change to any of the rules outside of terraform and thus instantly fails when I have noticed also under this circumstance.
My thinking is terraform could use a intermediary rule number that isn't occupied by any other whilst transitioning then make the final changes into the rightful numbers before cleaning up old rules. |
Having the same issue here:
If anyone needs it, to recover from this you can simply do |
ive noticed that same issue as @troxil. We create our rule numbers programmatically, ie:
If the number of availability zones changes, then terraform fails when doing a Granted, we're not going to be changing the number of AZs we assigned to a VPC that often, but the flexibility to be able to make those changes is part of the reason why we chose terraform |
Having this same issue causing HUGE problems intermittently in Production. We cannot rely on terraform to manage ACLs for us; there's just FAR too many issues like this. |
Can confirm this is still an issue in |
Still an issue in |
…n `InvalidNetworkAclID.NotFound` errors Reference: #2291 Before code update: ``` --- FAIL: TestAccAWSNetworkAclRule_disappears_NetworkAcl (24.71s) testing.go:568: Step 0 error: errors during follow-up refresh: Error: Error Finding Network Acl Rule 400: InvalidNetworkAclID.NotFound: The networkAcl ID 'acl-0d709bc679c758a63' does not exist status code: 400, request id: 52adcd9e-3bba-42a0-bff1-1a345a20f084 Error: Error Finding Network Acl Rule 200: InvalidNetworkAclID.NotFound: The networkAcl ID 'acl-0d709bc679c758a63' does not exist status code: 400, request id: b9e489d1-0610-4534-8df8-fcecd5217e1f Error: Error Finding Network Acl Rule 300: InvalidNetworkAclID.NotFound: The networkAcl ID 'acl-0d709bc679c758a63' does not exist status code: 400, request id: cdb09484-2cd0-4b3d-a3f0-759db25037b6 ``` Output from acceptance testing: ``` --- PASS: TestAccAWSNetworkAcl_disappears (28.17s) --- PASS: TestAccAWSNetworkAclRule_disappears_NetworkAcl (25.67s) --- PASS: TestAccAWSNetworkAclRule_disappears (28.40s) ```
Fix submitted: #9710 |
The fix for this has been merged and will release with version 2.25.0 of the Terraform AWS Provider, next week. 👍 |
This has been released in version 2.25.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform errors out if a defined NACL rule is not present when
terraform plan
is run.This appears to be due to a bug in the
findNetworkAclRule
function in the referenced .go file. I only became aware of this because I had googled the phrase "Expected the Network ACL to have Entries". I suspect that the correct behavior in this case is for the function to returnnil, nil
rather than falling all the way through to the "I give up" error case. I can't suggest the exact code fix, only that the existing function doesn't correctly act on the expected NACL rule missing when other NACL rules are present.Terraform Version
0.10.8
Affected Resource(s)
This appears to affect any possible aws_network_acl
Terraform Configuration Files
https://www.dropbox.com/s/d3a772eddq1nzz4/sample.zip.gpg?dl=0
Debug Output
https://gist.github.com/AVALARA-WESPAYNE/f5c2ad4c6ac9759e7137d42da94e287e
Expected Behavior
Creation of missing NACL rule added to terraform plan
Actual Behavior
Terraform exits, reporting error which includes output from AWS API DescribeNetworkAcls request.
Steps to Reproduce
terraform plan
References
The text was updated successfully, but these errors were encountered: