-
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
After import aws_autoscaling_group terraform plan doesn't show load_balancers diff #5197
Comments
I'm having a similar issue migrating an going from: resource "aws_autoscaling_group" {
...
load_balancers = ["${split(",", var.asg_load_balancer_names)}"]
...
} to: resource "aws_autoscaling_group" {
...
target_group_arns = ["${split(",", var.asg_target_group_arns)}"]
...
} generates the following diff:
This causes issue when autoscaling, as the ASG still references an ELB that might have been deleted. Specifying
which behaves as expected. I expect this might be because the load_balancers attribute is defined without a default, and the HasChange code is retrieving the current state instead of the expected null, but I'm not familiar enough with Go to parse where exactly the breakdown is. |
Also seeing this bug. I applied a change in TFE (AWS provider version 2.15.0, TF version 0.11.14) that attempted to remove the line from an
but no change was planned or applied and the ASG was not modified to remove the ELB check, causing future scale-ups to fail. |
addendum: it'll add the field if it's missing but won't remove it. |
…ns issue Closes: #5197 Upon configuring an ASG with load_balancers, it was found that swapping the load_balancers argument with a list of target_group_arns would result in no diff for the load_balancers despite them being removed. This issue being the computed property on `load_balancers`, which refreshes the configuration at plan time resulting in `load_balancers` being added back to the configuration as they are still part of the referenced infrastructure. This change fixes that be removing the `Computed` property on both `load_balancers` and `target_group_arns` to ensure Terraform always honors the arguments within a provided configuration. ``` --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (390.68s) --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup (468.74s) ```
…ns issue Closes: #5197 Upon configuring an ASG with load_balancers, it was found that swapping the load_balancers argument with a list of target_group_arns would result in no diff for the load_balancers despite them being removed. This issue being the computed property on `load_balancers`, which refreshes the configuration at plan time resulting in `load_balancers` being added back to the configuration as they are still part of the referenced infrastructure. This change fixes that be removing the `Computed` property on both `load_balancers` and `target_group_arns` to ensure Terraform always honors the arguments within a provided configuration. ``` --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (390.68s) --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup (468.74s) ```
Closes: #5197 Upon configuring an ASG with load_balancers, it was found that swapping the load_balancers argument with a list of target_group_arns would result in no diff for the load_balancers despite them being removed. This issue being the computed property on `load_balancers`, which refreshes the configuration at plan time resulting in `load_balancers` being added back to the configuration as they are still part of the referenced infrastructure. This change fixes that be removing the `Computed` property on both `load_balancers` and `target_group_arns` to ensure Terraform always honors the arguments within a provided configuration. ``` --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (390.68s) --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup (468.74s) ```
Folks, thanks for the help with this issue. I was able to reproduce it successfully within our testing. The fix to the |
Thank you so much! |
This has been released in version 2.21.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. However, please note that this introduces an unexpected behavior change in I'm going to proactively lock this issue only to encourage consolidation of discussions and efforts in #9513. |
Hi Folks, given the need to support the original functionality of At this time the suggested workaround for this issue is to explicitly set the argument for either Example
|
Hi!
Let me give a background
I imported ASG against my local terraform resource file. ASG in AWS have couple of ELB(classic) association. I can see that imported state contains ELB related information.
When I run plan, plan doesn't show any difference of load_balancers.
terraform import aws_autoscaling_group.existing-asg existing-asg-name
Why the plan not showing like below?
I just wonder, is it a bug? Or it's intended behaviour, why so?
The text was updated successfully, but these errors were encountered: