-
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
[aws_autoscaling_group] Provider produced inconsistent final plan (for tags) #14085
Comments
NOTE: I have tried rolling back the provider versions, and the first known version that works is |
After comparing the debug logs between The relevant log starts with:
v2.63.0
v2.64.0
So it appears that the transition to using sets for the tags has caused an issue with tags that depend on other resource values that are not known at plan time because those unknown vals ( |
Apologies for the spam - I deleted the message below when I thought the workaround didn't work when I integrated it into our real modules, but that was just a misunderstanding of the error message. Restored message: Ok I found a workaround by using resource "aws_autoscaling_group" "web" {
max_size = 1
min_size = 1
desired_capacity = 1
name = aws_launch_configuration.web_conf.name
launch_configuration = aws_launch_configuration.web_conf.name
vpc_zone_identifier = data.aws_subnet_ids.default.ids
dynamic "tag" {
for_each = local.tags
content {
key = tag.value.key
value = tag.value.value
propagate_at_launch = tag.value.propagate_at_launch
}
}
}
locals {
tags = [
{
key = "Name"
value = "servers"
propagate_at_launch = true
},
{
key = "LCNAME1"
value = aws_launch_configuration.web_conf.name
propagate_at_launch = true
},
{
key = "LCNAME2"
value = aws_launch_configuration.web_conf.name
propagate_at_launch = true
},
]
} |
hi @yorinasub17, thank you for reporting this issue and working through an alternative here! making a quick pass through your config, I can see the references to
Snippet of plan w/original config
vs. Snippet of plan w/original config + wrapping exprs. w/parens:
|
@anGie44 Thanks for taking the time to look at this, and apologies for taking time to respond. I just tried what you provided (with the parens), and unfortunately I still have the same issue. Looking at your plan, it looks like you tried the apply with parens on a second run based on the fact that the plan has the Can you try running destroy to clear the state and then running |
``` Error: Provider produced inconsistent final plan When expanding the plan for module.eks.aws_autoscaling_group.workers[0] to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value for .tags: length changed from 4 to 6. ``` hashicorp/terraform-provider-aws#14085
Additional support for Terraform v0.13 and aws v3! - The update to the vpc module in examples was, strictly speaking, unnecessary but it adds the terraform block with supported versions. - Update for iam module in the example was very necessary to support new versions - Workaround for "Provider produced inconsistent final plan" when creating ASGs at the same time as the cluster. See hashicorp/terraform-provider-aws#14085 for full details. - Blacklist 0.13.0 as it was too strict when migrating from aws v2 to v3 about dropped attributes.
…rm-aws-modules#976) Additional support for Terraform v0.13 and aws v3! - The update to the vpc module in examples was, strictly speaking, unnecessary but it adds the terraform block with supported versions. - Update for iam module in the example was very necessary to support new versions - Workaround for "Provider produced inconsistent final plan" when creating ASGs at the same time as the cluster. See hashicorp/terraform-provider-aws#14085 for full details. - Blacklist 0.13.0 as it was too strict when migrating from aws v2 to v3 about dropped attributes.
An unsolved regression in the terraform-provider-aws ( hashicorp/terraform-provider-aws#14085 ) prevents the creation of autoscaling groups using terraform.
* 📌 version updates for all major components | #85 Covering the following dependencies: - nomad: 1.0.2 - consul: 1.9.1 - fabio - terraform modules - terraform-aws-consul module version 0.8.2 - packer definition - terraform: 0.14.4 * ♻️ Migrate from SSH to SSM and restructuring | #83 - Remove SSH dependency - Using AWS System Manager Session Manager instead of SSH access. * ✨ AMI testing during creation - Checking the AMI during the packer build step using goss. * ✨ restart nomad service on instance, solves #62 * 👷 added linting * 🐛 fixing aws provider version due to autoscaling issue An unsolved regression in the terraform-provider-aws ( hashicorp/terraform-provider-aws#14085 ) prevents the creation of autoscaling groups using terraform. * 💩 using fork to unblock waiting for PR | #85 Waiting for PR to be merge: hashicorp/terraform-aws-nomad#85 Co-authored-by: Matthias Scholz <[email protected]> Co-authored-by: Matthias Scholz <[email protected]>
Additional support for Terraform v0.13 and aws v3! - The update to the vpc module in examples was, strictly speaking, unnecessary but it adds the terraform block with supported versions. - Update for iam module in the example was very necessary to support new versions - Workaround for "Provider produced inconsistent final plan" when creating ASGs at the same time as the cluster. See hashicorp/terraform-provider-aws#14085 for full details. - Blacklist 0.13.0 as it was too strict when migrating from aws v2 to v3 about dropped attributes.
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
still an issue |
Community Note
Terraform Version
Also tested and repro'd with:
Affected Resource(s)
aws_autoscaling_group
Terraform Configuration Files
Expected Behavior
Apply completes successfully, creating the Autoscaling Group.
Actual Behavior
The first apply fails with the following error message:
Note that the second apply succeeds, presumably because the values for all the tags are known at this point.
Steps to Reproduce
terraform init
terraform apply
The text was updated successfully, but these errors were encountered: