_This issue was originally opened by @joshuaspence as hashicorp/terraform#13187. It was migrated here as part of the provider split. The original body of the issue is below._
I have found a bug that occurs seems related to use the of ignore_changes
with the aws_autoscaling_group
resources. I am running Terraform 0.9.2. I can reproduce the issue with the following Terraform code:
variable "image_id" {
type = "string"
}
variable "name" {
type = "string"
}
resource "aws_autoscaling_group" "test" {
name = "${var.name}"
max_size = 1
min_size = 1
availability_zones = ["us-east-1a"]
launch_configuration = "${aws_launch_configuration.test.name}"
lifecycle {
ignore_changes = ["name"]
}
}
resource "aws_launch_configuration" "test" {
name_prefix = "tf_test-"
image_id = "${var.image_id}"
instance_type = "c3.large"
lifecycle {
create_before_destroy = true
}
}
With this configuration in place, run the following commands:
# terraform apply -var image_id=ami-2657f630 -var name=tf_test
# terraform apply -var image_id=ami-158b3303 -var name=tf_test2
The exact values of the image_id
and name
variables doesn't matter, as long as they are different in second run. The error that is produced is as follows:
aws_launch_configuration.test: Refreshing state... (ID: tf_test-0...70a29f77)
aws_autoscaling_group.test: Refreshing state... (ID: tf_test)
aws_launch_configuration.test: Creating...
associate_public_ip_address: "" => "false"
ebs_block_device.#: "" => "<computed>"
ebs_optimized: "" => "<computed>"
enable_monitoring: "" => "true"
image_id: "" => "ami-158b3303"
instance_type: "" => "c3.large"
key_name: "" => "<computed>"
name: "" => "<computed>"
name_prefix: "" => "tf_test-"
root_block_device.#: "" => "<computed>"
aws_launch_configuration.test: Creation complete (ID: tf_test-0...6e49db83)
aws_launch_configuration.test (deposed #0): Destroying... (ID: tf_test-0...70a29f77)
Error applying plan:
1 error(s) occurred:
* aws_launch_configuration.test (destroy): 1 error(s) occurred:
* aws_launch_configuration.test (deposed #0): 1 error(s) occurred:
* aws_launch_configuration.test (deposed #0): ResourceInUse: Cannot delete launch configuration tf_test-0032abec1453c509c670a29f77 because it is attached to AutoScalingGroup tf_test
status code: 400, request id: 8ef323a2-14e3-11e7-a485-2dff213f38cb
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
tl;dr: aws_autoscaling_group
with ignore_changes = ["desired_capacity"]
doesn't get updated when name
changes.
Hi folks.
I believe we're seeing something related to the above with the current release of TF 0.9.11. The use case is a little more complicated than what's below (blue/green deployment with ELB attachment swap and desired capacity of each deployment group managed by a CD system outside of this Terraform module) but I've whittled it down to an isolated test case to demonstrate the issue.
data "aws_vpc" "selected" {
id = "vpc-290bf84f"
}
data "aws_subnet_ids" "all" {
vpc_id = "${data.aws_vpc.selected.id}"
}
resource "aws_autoscaling_group" "app_server" {
name = "asg-test-${aws_launch_configuration.app_server.name}"
vpc_zone_identifier = ["${data.aws_subnet_ids.all.ids}"]
min_size = "0"
max_size = "10"
desired_capacity = "3"
launch_configuration = "${aws_launch_configuration.app_server.name}"
tag {
key = "Name"
value = "asg-test"
propagate_at_launch = "true"
}
lifecycle {
create_before_destroy = true
ignore_changes = ["desired_capacity"]
}
}
resource "aws_launch_configuration" "app_server" {
image_id = "ami-d15a75c7"
#image_id = "ami-a60c23b0"
instance_type = "t2.nano"
lifecycle {
create_before_destroy = true
}
}
Note that the name of the launch configuration is interpolated by the ASG name. Twiddling the image_id
s in the launch config results in another launch config being created and the old one destroyed but that dependency change isn't bubbling up to the autoscaling group resource and causing it to be recreated, which is what one might expect.
Removing ignore_changes
from the ASG results in the expected behavior of both launch config and ASG being recreated.
Here is the terraform plan
output showing only the launch config being recreated after twiddling AMI IDs. Note the missing aws_autoscaling_group
.
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
aws_launch_configuration.app_server: Refreshing state... (ID: terraform-000fd214c34d40b55084ac42eb)
data.aws_vpc.selected: Refreshing state...
data.aws_subnet_ids.all: Refreshing state...
aws_autoscaling_group.app_server: Refreshing state... (ID: asg-test-terraform-000fd214c34d40b55084ac42eb)
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
-/+ aws_launch_configuration.app_server
associate_public_ip_address: "false" => "false"
ebs_block_device.#: "0" => "<computed>"
ebs_optimized: "false" => "<computed>"
enable_monitoring: "true" => "true"
image_id: "ami-d15a75c7" => "ami-a60c23b0" (forces new resource)
instance_type: "t2.nano" => "t2.nano"
key_name: "" => "<computed>"
name: "terraform-000fd214c34d40b55084ac42eb" => "<computed>"
root_block_device.#: "0" => "<computed>"
Plan: 1 to add, 0 to change, 1 to destroy.
And the result of the previous plan's terraform apply
failing in a way similar to that reported by @joshuaspence.
$ terraform apply
aws_launch_configuration.app_server: Refreshing state... (ID: terraform-000fd214c34d40b55084ac42eb)
data.aws_vpc.selected: Refreshing state...
data.aws_subnet_ids.all: Refreshing state...
aws_autoscaling_group.app_server: Refreshing state... (ID: asg-test-terraform-000fd214c34d40b55084ac42eb)
aws_launch_configuration.app_server: Creating...
associate_public_ip_address: "" => "false"
ebs_block_device.#: "" => "<computed>"
ebs_optimized: "" => "<computed>"
enable_monitoring: "" => "true"
image_id: "" => "ami-a60c23b0"
instance_type: "" => "t2.nano"
key_name: "" => "<computed>"
name: "" => "<computed>"
root_block_device.#: "" => "<computed>"
aws_launch_configuration.app_server: Creation complete (ID: terraform-004460a57b1d36622ac5a26ce2)
aws_launch_configuration.app_server (deposed #0): Destroying... (ID: terraform-000fd214c34d40b55084ac42eb)
Error applying plan:
1 error(s) occurred:
* aws_launch_configuration.app_server (destroy): 1 error(s) occurred:
* aws_launch_configuration.app_server (deposed #0): 1 error(s) occurred:
* aws_launch_configuration.app_server (deposed #0): ResourceInUse: Cannot delete launch configuration terraform-000fd214c34d40b55084ac42eb because it is attached to AutoScalingGroup asg-test-terraform-000fd214c34d40b55084ac42eb
status code: 400, request id: 58cb68fd-70b0-11e7-b7e3-bf52912d49ef
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Just for giggles, here's the same module's terraform plan
without ignore_changes = ["desired_capacity"]
set on the ASG. Note that both the launch config and ASG are recreated.
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
aws_launch_configuration.app_server: Refreshing state... (ID: terraform-002a7dd04faba69f5080978525)
data.aws_vpc.selected: Refreshing state...
data.aws_subnet_ids.all: Refreshing state...
aws_autoscaling_group.app_server: Refreshing state... (ID: asg-test-terraform-002a7dd04faba69f5080978525)
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
-/+ aws_autoscaling_group.app_server
arn: "arn:aws:autoscaling:us-east-1:478187763210:autoScalingGroup:caca889e-2ae1-469b-92ae-6c56cfce3791:autoScalingGroupName/asg-test-terraform-002a7dd04faba69f5080978525" => "<computed>"
availability_zones.#: "4" => "<computed>"
default_cooldown: "300" => "<computed>"
desired_capacity: "3" => "3"
force_delete: "false" => "false"
health_check_grace_period: "300" => "300"
health_check_type: "EC2" => "<computed>"
launch_configuration: "terraform-002a7dd04faba69f5080978525" => "${aws_launch_configuration.app_server.name}"
load_balancers.#: "0" => "<computed>"
max_size: "10" => "10"
metrics_granularity: "1Minute" => "1Minute"
min_size: "0" => "0"
name: "asg-test-terraform-002a7dd04faba69f5080978525" => "asg-test-${aws_launch_configuration.app_server.name}" (forces new resource)
protect_from_scale_in: "false" => "false"
tag.#: "1" => "1"
tag.4040511139.key: "Name" => "Name"
tag.4040511139.propagate_at_launch: "true" => "true"
tag.4040511139.value: "asg-test" => "asg-test"
target_group_arns.#: "0" => "<computed>"
vpc_zone_identifier.#: "4" => "4"
vpc_zone_identifier.1205371225: "subnet-5bb10f76" => "subnet-5bb10f76"
vpc_zone_identifier.180518870: "subnet-e90960a0" => "subnet-e90960a0"
vpc_zone_identifier.3476144910: "subnet-3c51e267" => "subnet-3c51e267"
vpc_zone_identifier.3662529929: "subnet-ae469a92" => "subnet-ae469a92"
wait_for_capacity_timeout: "10m" => "10m"
-/+ aws_launch_configuration.app_server
associate_public_ip_address: "false" => "false"
ebs_block_device.#: "0" => "<computed>"
ebs_optimized: "false" => "<computed>"
enable_monitoring: "true" => "true"
image_id: "ami-a60c23b0" => "ami-d15a75c7" (forces new resource)
instance_type: "t2.nano" => "t2.nano"
key_name: "" => "<computed>"
name: "terraform-002a7dd04faba69f5080978525" => "<computed>"
root_block_device.#: "0" => "<computed>"
Plan: 2 to add, 0 to change, 2 to destroy.
Please let us know if we can provide any more troubleshooting details or if maybe we're just Doing It Wrong (TM). :) I haven't had a chance to dig into the provider code yet but may get some time over the next few days to look a bit closer.
Thanks!
Seeing this with TF 0.10.8 and the 1.2.0 AWS provider. In particular, this happens if I update the AMI I am using for the ASG, which is referenced in my TF config witha data block:
data "aws_ami" "audprocessor_autoscale_ami_dev1" {
most_recent = true
name_regex = "^audprocessor-autoscale-image.*$"
owners = ["self"]
}
I get this:
Error: Error applying plan:
1 error(s) occurred:
aws_launch_configuration.audprocessor_launch_config_dev1 (destroy): 1 error(s) occurred:
aws_launch_configuration.audprocessor_launch_config_dev1: ResourceInUse: Cannot delete launch configuration audprocessor-launch-config-dev because it is attached to AutoScalingGroup
status code: 400, request id: b655324e-c361-11e7-8002-afbcf1f101f7
Have the same problem
autoscaling_terraform.bug.log
my configuration:
###
## create network
###
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
name = "${var.vpc_name}"
cidr = "${var.vpc_cidr}"
azs = "${var.vpc_azs}"
public_subnets = "${var.public_subnets}"
database_subnets = "${var.database_subnets}"
create_database_subnet_group = false
enable_nat_gateway = false
enable_vpn_gateway = false
tags {
Terraform = "true"
Environment = "stage"
}
}
###
## create security groups
###
module "zabbix_web_sg" {
source = "terraform-aws-modules/security-group/aws"
name = "zabbix_web_sg"
description = "security group for zabbix web fronend"
vpc_id = "${module.vpc.vpc_id}"
ingress_cidr_blocks = "${var.public_subnets}"
ingress_rules = ["http-80-tcp", "https-443-tcp"]
tags {
Terraform = "true"
Environment = "stage"
Service = "zabbix"
Subsystem = "zabbix_web"
}
}
module "zabbix_app_sg" {
source = "terraform-aws-modules/security-group/aws"
name = "zabbix_app_sg"
description = "security group for zabbix server"
vpc_id = "${module.vpc.vpc_id}"
ingress_with_cidr_blocks = [
{
from_port = "${var.zabbix_app_listen_port}"
to_port = "${var.zabbix_app_listen_port}"
protocol = "tcp"
description = "zabbix server"
cidr_blocks = "${var.vpc_cidr}"
},
{
from_port = "${var.zabbix_app_snmp_port}"
to_port = "${var.zabbix_app_snmp_port}"
protocol = "udp"
description = "zabbix server snmp"
cidr_blocks = "${join(",", module.vpc.public_subnets_cidr_blocks)}"
},
]
tags {
Terraform = "true"
Environment = "stage"
Service = "zabbix"
Subsystem = "zabbix_app"
}
}
module "zabbix_lb_sg" {
source = "terraform-aws-modules/security-group/aws"
name = "zabbix_lb_sg"
description = "zabbix load balancer security group"
vpc_id = "${module.vpc.vpc_id}"
ingress_cidr_blocks = ["0.0.0.0/0"]
ingress_rules = ["http-80-tcp", "https-443-tcp"]
tags {
Terraform = "true"
Environment = "stage"
Service = "zabbix"
Subsystem = "zabbix_lb"
}
}
module "bastion_sg" {
source = "terraform-aws-modules/security-group/aws"
name = "bastion_sg"
description = "bastion security group"
vpc_id = "${module.vpc.vpc_id}"
ingress_cidr_blocks = ["0.0.0.0/0"]
ingress_rules = ["ssh-tcp"]
tags {
Terraform = "true"
Environment = "stage"
Service = "bastion"
Subsystem = "sshd"
}
}
module "allow_egress_all" {
source = "terraform-aws-modules/security-group/aws"
name = "allow_egress_all"
description = "allow all egress traffic"
vpc_id = "${module.vpc.vpc_id}"
egress_with_cidr_blocks = [
{
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = "0.0.0.0/0"
},
]
tags {
Terraform = "true"
Environment = "stage"
Service = "NA"
Subsystem = "NA"
}
}
###
## create instances
###
module "zabbix_app_asg" {
source = "git::https://github.com/terraform-aws-modules/terraform-aws-autoscaling.git?ref=v1.1.0"
# Launch configuration
lc_name = "${var.zabbix_app_lc_name}"
image_id = "${data.aws_ami.centos.id}"
// image_id = "ami-e535c59d"
instance_type = "${var.default_instance_type}"
// associate_public_ip_address = true
security_groups = [
"${module.zabbix_app_sg.this_security_group_id}",
"${module.allow_egress_all.this_security_group_id}",
]
# Auto scaling group
asg_name = "${var.zabbix_app_asg_name}"
vpc_zone_identifier = "${module.vpc.public_subnets}"
health_check_type = "EC2"
min_size = 0
max_size = 1
desired_capacity = 1
wait_for_capacity_timeout = 0
tags = [
{
key = "Environment"
value = "stage"
propagate_at_launch = true
},
{
key = "Terraform"
value = "true"
propagate_at_launch = true
},
{
key = "Service"
value = "zabbix"
propagate_at_launch = true
},
{
key = "Subsystem"
value = "zabbix_app"
propagate_at_launch = true
},
]
}
module "zabbix_web_asg" {
source = "git::https://github.com/terraform-aws-modules/terraform-aws-autoscaling.git?ref=v1.1.0"
# Launch configuration
lc_name = "${var.zabbix_web_lc_name}"
image_id = "${data.aws_ami.centos.id}"
// image_id = "ami-e535c59d"
instance_type = "${var.default_instance_type}"
// associate_public_ip_address = true
security_groups = [
"${module.zabbix_web_sg.this_security_group_id}",
"${module.allow_egress_all.this_security_group_id}",
]
load_balancers = ["${module.zabbix_web_elb.this_elb_id}"]
# auto scaling group
asg_name = "${var.zabbix_web_asg_name}"
vpc_zone_identifier = "${module.vpc.public_subnets}"
health_check_type = "EC2"
min_size = 1
max_size = 3
desired_capacity = 2
wait_for_capacity_timeout = 0
tags = [
{
key = "Environment"
value = "stage"
propagate_at_launch = true
},
{
key = "Terraform"
value = "true"
propagate_at_launch = true
},
{
key = "Service"
value = "zabbix"
propagate_at_launch = true
},
{
key = "Subsystem"
value = "zabbix_web"
propagate_at_launch = true
},
]
}
module "bastion_ec2" {
source = "terraform-aws-modules/ec2-instance/aws"
name = "${var.bastion_ec2_name}"
count = 1
ami = "${data.aws_ami.centos.id}"
instance_type = "${var.default_instance_type}"
key_name = "${var.default_key_name}"
monitoring = false
associate_public_ip_address = true
subnet_id = "${module.vpc.public_subnets[0]}"
vpc_security_group_ids = [
"${module.bastion_sg.this_security_group_id}",
"${module.allow_egress_all.this_security_group_id}",
]
tags {
Terraform = "true"
Environment = "stage"
Service = "bastion"
Subsystem = "sshd"
}
}
###
## load balancers
##
module "zabbix_web_elb" {
source = "terraform-aws-modules/elb/aws"
name = "${var.zabbix_web_elb_name}"
subnets = "${module.vpc.public_subnets}"
security_groups = [
"${module.zabbix_lb_sg.this_security_group_id}",
"${module.allow_egress_all.this_security_group_id}",
]
internal = false
listener = [
{
instance_port = "80"
instance_protocol = "HTTP"
lb_port = "80"
lb_protocol = "HTTP"
},
]
health_check = [
{
target = "HTTP:80/"
interval = "${var.zabbix_web_elb_hc_interval}"
healthy_threshold = "${var.zabbix_web_elb_hc_healthy_threshold}"
unhealthy_threshold = "${var.zabbix_web_elb_hc_unhealthy_threshold}"
timeout = "${var.zabbix_web_elb_hc_timeout}"
},
]
tags {
Terraform = "true"
Environment = "stage"
Service = "zabbix"
Subsystem = "zabbix_web"
}
}
Steps to reproduce:
__Terraform plan__
Terraform will perform the following actions:
-/+ module.bastion_ec2.aws_instance.this (new resource required)
id: "i-0b6c477dc873c8cb8" => <computed> (forces new resource)
ami: "ami-e535c59d" => "ami-e535c59d"
associate_public_ip_address: "true" => "true"
availability_zone: "us-west-2a" => <computed> (forces new resource)
disable_api_termination: "false" => "false"
ebs_optimized: "false" => "false"
instance_state: "running" => <computed>
instance_type: "t2.nano" => "t2.nano"
ipv6_address_count: "0" => "0"
key_name: "my-key" => "my-key"
monitoring: "false" => "false"
network_interface.#: "0" => <computed>
network_interface_id: "eni-c5d5eef6" => <computed>
placement_group: "" => <computed>
primary_network_interface_id: "eni-c5d5eef6" => <computed>
private_dns: "ip-192-168-128-226.us-west-2.compute.internal" => <computed>
private_ip: "192.168.128.226" => <computed> (forces new resource)
public_dns: "" => <computed>
public_ip: "34.208.179.124" => <computed>
root_block_device.#: "1" => "0"
root_block_device.0.delete_on_termination: "false" => "true" (forces new resource)
security_groups.#: "0" => <computed>
source_dest_check: "true" => "true"
subnet_id: "subnet-edd0a0a5" => "subnet-edd0a0a5"
tags.%: "5" => "5"
tags.Environment: "stage" => "stage"
tags.Name: "bastion-1" => "bastion-1"
tags.Service: "bastion" => "bastion"
tags.Subsystem: "sshd" => "sshd"
tags.Terraform: "true" => "true"
tenancy: "default" => "default"
user_data: "da39a3ee5e6b4b0d3255bfef95601890afd80709" => "da39a3ee5e6b4b0d3255bfef95601890afd80709"
volume_tags.%: "0" => <computed>
vpc_security_group_ids.#: "2" => "2"
vpc_security_group_ids.1126502728: "sg-9026d5ec" => "sg-9026d5ec"
vpc_security_group_ids.73163838: "sg-2b3dce57" => "sg-2b3dce57"
~ module.zabbix_app_asg.module.autoscaling_group.aws_autoscaling_group.this
launch_configuration: "zabbix-app-lc-20171125225647460700000002" => "${var.launch_configuration}"
-/+ module.zabbix_app_asg.module.launch_configuration.aws_launch_configuration.this (new resource required)
id: "zabbix-app-lc-20171125225647460700000002" => <computed> (forces new resource)
associate_public_ip_address: "false" => "true" (forces new resource)
ebs_optimized: "false" => "false"
enable_monitoring: "true" => "true"
image_id: "ami-e535c59d" => "ami-e535c59d"
instance_type: "t2.nano" => "t2.nano"
key_name: "" => <computed>
name: "zabbix-app-lc-20171125225647460700000002" => <computed>
name_prefix: "zabbix-app-lc-" => "zabbix-app-lc-"
placement_tenancy: "default" => "default"
security_groups.#: "2" => "2"
security_groups.1126502728: "sg-9026d5ec" => "sg-9026d5ec"
security_groups.1797350364: "sg-7827d404" => "sg-7827d404"
user_data: "da39a3ee5e6b4b0d3255bfef95601890afd80709" => "da39a3ee5e6b4b0d3255bfef95601890afd80709"
~ module.zabbix_web_asg.module.autoscaling_group.aws_autoscaling_group.this
launch_configuration: "zabbix-web-lc-20171125225644247500000001" => "${var.launch_configuration}"
-/+ module.zabbix_web_asg.module.launch_configuration.aws_launch_configuration.this (new resource required)
id: "zabbix-web-lc-20171125225644247500000001" => <computed> (forces new resource)
associate_public_ip_address: "false" => "true" (forces new resource)
ebs_optimized: "false" => "false"
enable_monitoring: "true" => "true"
image_id: "ami-e535c59d" => "ami-e535c59d"
instance_type: "t2.nano" => "t2.nano"
key_name: "" => <computed>
name: "zabbix-web-lc-20171125225644247500000001" => <computed>
name_prefix: "zabbix-web-lc-" => "zabbix-web-lc-"
placement_tenancy: "default" => "default"
security_groups.#: "2" => "2"
security_groups.1126502728: "sg-9026d5ec" => "sg-9026d5ec"
security_groups.4052033360: "sg-9726d5eb" => "sg-9726d5eb"
user_data: "da39a3ee5e6b4b0d3255bfef95601890afd80709" => "da39a3ee5e6b4b0d3255bfef95601890afd80709"
Plan: 3 to add, 2 to change, 3 to destroy.
Terraform v0.11.0
+ provider.aws v1.3.1
Seeing same issue in version 0.11.5
resource "aws_launch_configuration" "webnode" {
count = "${var.web_server["asg_enabled"] ? 1 : 0}"
name = "webnode"
image_id = "${var.web_server_ami != "" ? var.web_server_ami : var.web_server["ami_id"]}"
instance_type = "${var.web_server["instance_size"]}"
key_name = "${var.web_server["ec2_user_key"]}"
user_data = "${base64encode(file("./modules/web-server/user_data"))}"
security_groups = [
"${var.internal_web_server_security_group_id}",
"${var.default_security_group_id}"
]
associate_public_ip_address = false
iam_instance_profile = "${aws_iam_instance_profile.web_instance_profile.arn}"
root_block_device {
volume_type = "gp2"
volume_size = "${var.web_server["volume_size"]}"
delete_on_termination = true
}
}
resource "aws_autoscaling_group" "www" {
count = "${var.web_server["asg_enabled"] ? 1 : 0}"
vpc_zone_identifier = ["${var.private_subnet_ids[0]}", "${var.private_subnet_ids[1]}"]
name = "www-asg"
max_size = "${var.web_server["max_size"]}"
min_size = "${var.web_server["min_size"]}"
wait_for_capacity_timeout = 0
health_check_grace_period = 300
health_check_type = "EC2"
desired_capacity = "${var.web_server["desired_count"]}"
force_delete = true
launch_configuration = "${aws_launch_configuration.webnode.name}"
target_group_arns = ["${aws_alb_target_group.treasurersbriefcase.arn}"]
tag {
key = "Name"
value = "${var.env}-webnode"
propagate_at_launch = true
}
tag {
key = "Environment"
value = "${var.env}"
propagate_at_launch = true
}
}
resource "aws_autoscaling_attachment" "asg_attachment" {
count = "${var.web_server["asg_enabled"] ? 1 : 0}"
autoscaling_group_name = "${aws_autoscaling_group.www.id}"
alb_target_group_arn = "${aws_alb_target_group.treasurersbriefcase.arn}"
}
Any news about this? This is still an issue, and mentioned multiple times in terraform bugs.
The fix for this has been merged and will release with version 2.1.0 of the Terraform AWS Provider, likely later today.
This has been released in version 2.1.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
@bflad can this be re-opened? we are seeing this issue with tf 11.7 and aws provider 2.1-2.2. Changing ami reference in lc, with ignore_changes
desired_capacity on the asg set, causes only the lc to be marked recreation which then fails since the asg is still attached to the old lc.
Having the same issue with aws provider 2.2.0 and terraform 0.11.13.
Hi folks 👋 I'd suggest opening a new bug report and filling in the issue details so we can appropriately triage. There may be additional cases we are not covering in the acceptance testing and getting example configurations with logs will help us work through them. Thanks.
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.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
@bflad can this be re-opened? we are seeing this issue with tf 11.7 and aws provider 2.1-2.2. Changing ami reference in lc, with
ignore_changes
desired_capacity on the asg set, causes only the lc to be marked recreation which then fails since the asg is still attached to the old lc.