Open EugenKon opened 1 month ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @EugenKon 👋 Thank you for taking the time to raise this! Are you able to supply a sample configuration that can be used to reproduce this, and/or debug logs (redacted as needed)?
@justinretzolk
This is the resource which is related to this TF state. I can not share the configuration for a full cluster.
resource "aws_autoscaling_group" "www" {
name = "www-autoscale"
desired_capacity = 2
min_size = 2
max_size = 2
protect_from_scale_in = true
launch_template {
id = aws_launch_template.www.id
version = "$Latest"
}
+ vpc_zone_identifier = [
+ aws_subnet.a_private_prd_plntr.id,
+ aws_subnet.b_private_prd_plntr.id,
+ aws_subnet.c_private_prd_plntr.id,
+ aws_subnet.d_private_prd_plntr.id,
+ ]
target_group_arns = [
aws_lb_target_group.www-http.arn,
aws_lb_target_group.www-https-autoscale.arn,
]
# Required to redeploy without an outage.
lifecycle {
create_before_destroy = true
}
tag {
key = "env"
propagate_at_launch = true
value = "prd"
}
tag {
key = "role"
propagate_at_launch = true
value = "www"
}
tag {
key = "managed_by"
propagate_at_launch = true
value = "autoscale"
}
}
Hey @EugenKon, totally understand the limitations. Based on what you provided in your last comment, is it safe to say that the change that's being made to the configuration when you noticed the issue is the addition of the vpc_zone_identifier
argument to the aws_autoscaling_group
resource?
@justinretzolk The issue was that AWS deployed new autoscale instances in the different network (This is not TF issue). We discovered that and changed the subnets for network via AWS Console. But then detected that TF does not recognize this change. When we added "vpc_zone_identifier" it does. So I believe, that TF should not store the state for the resource which it does not manage OR if something is in TF state, it should display changes.
Terraform Core Version
v1.8.2
AWS Provider Version
v4.67.0
Affected Resource(s)
Expected Behavior
Terraform should show mismatches between state and actual configuration.
Actual Behavior
Terraform does not show mismatches
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Current terraform.state
Current live configuration
This configuration correspons to current live configuration:
Steps to Reproduce
terraform plan
Terraform compares current configuration with live configuration and does not change the old TF state which refers to the old TF configuration.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None