terraform-provider-aws: Error: aws_autoscaling_group - Provider produced inconsistent final plan
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform Version
v0.12.6
Affected Resource(s)
- aws_autoscaling_group
Expected Behavior
terraform apply should finish with no errors
Actual Behavior
Error: Provider produced inconsistent final plan
When expanding the plan for module.eks_stack.aws_autoscaling_group.as_node_group to include new values learned so far during apply, provider “aws” produced an invalid new value for .availability_zones: was known, but now unknown.
This is a bug in the provider, which should be reported in the provider’s own issue tracker.
Steps to Reproduce
terraform apply
Important Factoids
This completes OK on running a second terraform apply
References
This issue was originally raised in the terraform GitHub, but then following an update of terraform, the error produced mentioned an issue with provider. I was advised to then open an issue with the provider. Ref: https://github.com/hashicorp/terraform/issues/21012
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 74
- Comments: 22 (7 by maintainers)
Hey, i can confirm we’re still facing this issue :
Another kind of error that we’re facing:
These errors are only happening when we’re creating an aws_eks_cluster (which takes roughly 13min), an aws_launch_template and the aws_autoscaling_group on the same run. (3 resources)
Once the EKS cluster is created (and the failure of the apply), we can relaunch a terraform apply and create the launch template and the autoscaling group without any issues. Maybe related to something computed at the beginning of the run that is updated later on?
By the way : we’re using the latest version of the provider (“3.69.0”) and terraform version 1.1.0
I’ve seen this as well, but I think it’s because I’m using a value from
random_stringin the tags; the random value isn’t available until apply-time, at which point terraform freaks out that things have changed. In fact, the list of tags during the plan shows that some items are(known after apply).However, since Terraform knows that the values won’t be known until they’re available, it should proceed without throwing the warning.
Here’s the actual output:
This is the output of
terraform -version:This happened to me because I was using both
availability_zonesandvpc_zone_identifierinaws_autoscaling_group.The documentation mentions:
The error is gone if I don’t specify the two, but it took a little sleuthing to piece this together.
Looks very similar to https://github.com/terraform-providers/terraform-provider-aws/issues/10615
Sometimes just running
terraform applyagain will work. But if it doesn’t, as a workaround you can mark the resource as tainted with-taintand then runterraform applyagain. This will force the resource to be re-created.@justinretzolk I have not seen this problem in quite some time. For the record, we are mostly on
awsprovider version3.54+and Terraform1.0.0+at this point.