-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Not possible to upgrade to terraform 0.12 if using resource aws_lb_listener_certificate #8751
Comments
We have the same problem with aws_iam_role_policy_attachment.
Note that we actually attach 5 policies. It only complains on one. |
I am currently having the same problem - is there any fix or workaround for this? |
@neelam-007 In our case it was because we were referencing a deprecated AWS provided policy. Check if the policyies your are attaching are AWS provided and deprecated. If so attach policy is doing very weird. |
A temporary workaround is to comment out the |
That would work only if the resource has already been created, and adds manual labour to your deploy. As for creating a new resource, after converting to 0.12, you would get this exception from the start (at which point, you could comment it out and commit again). At this point it would make more sense to stop using the resource and make a cli call to create it instead. |
I had the same error with I believe this problem is mostly that the error message is obscure and unrelated. I tried applying the erroneous policy via the aws-cli to see the error it would return and apparently it returns nothing:
It behaves the same when the ARN is the right one too and I believe the aws provider's checks after applying get thrown off somehow. |
Same experience as @vivanov-dp, except applying an Using the correct partition fixed the issue and did not display this error. AWS provider v2.58.0 |
Finally had time to look into this. Turns out, the error is not per se with persisting to state, but the read function deletes it from state if the profile running terraform doesn't have the |
I think the proper "fix" here is to convert |
Just want to thank you, @Frogvall, that two years later, this is still an issue in Terraform v1.3.0 with hashicorp/aws v4.32.0, and I was absolutely stuck trying to get past this error:
And granting the Terraform role Generally when an API call fails due to insufficient permission, Terraform is good about reporting it - if it did that in this case, it would certainly have saved me a bunch of time. |
You're welcome! :) |
Thanks, @Frogvall! Indeed, |
@pieterjanpintens @neelam-007 @vivanov-dp I looked through the code for TL;DR: If you are still seeing issues with aws_iam_role_policy_attachment`, please 🙏 open a new issue so that we can prioritize and look at that! |
@YakDriver Hey, thanks for taking care of this and sorry for sticking an unrelated problem to this issue back then, but in my defense - the error message was the same. I tried
And the error is: To me this means that, again, since AWS returns no indication of success or failure, Terraform expects the resource to have been created, can't read it and outputs a generic error. |
Yeah, it's definitely better than what was happening with The normal retry after create actually is in the read. Normally it's in create but here it makes sense because the eventual consistency can happen in more places. It probably wouldn't hurt to also have a wait in create. But, either way it doesn't help much since there's no actual error from AWS. We're just making this one up based on the failure to create. It's a little wonky but hard to do much different based on the API reponses (lack of create/attach error). |
This functionality has been released in v4.51.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. Thank you! |
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. |
Community Note
Terraform Version
0.12.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
aws_lb_listener_certificate
should have been included in the state file.Actual Behavior
aws_lb_listener_certificate
is not included in the state file, and terraform apply fails with the current error message:Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: