terraform-aws-ec2-autoscale-group icon indicating copy to clipboard operation
terraform-aws-ec2-autoscale-group copied to clipboard

launch_template_version $Latest does not trigger instance refresh when user-data or launch_tempate is updated.

Open harshitp1987 opened this issue 1 year ago • 2 comments

Describe the Bug

launch_template_version $Latest does not trigger instance refresh when user-data or launch_tempate is updated.

Expected Behavior

When launch_template is updated , the latest version should be picked up by Autoscaling group and it should trigger instance refresh

Steps to Reproduce

Steps to reproduce the behavior:

  1. Update the user-data or instance type or AMI
  2. run terraform apply
  3. it should show the launchtemplate update
  4. it updates the launch template but, does not trigger instance refresh

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: Amazon Linux2

harshitp1987 avatar Jul 11 '22 08:07 harshitp1987

With Terraform 1.2, I think we can fix this. We can have a structure like this:

resource "aws_lt" "this" {
...
}

data "aws_lt" "this" {
  id = aws_lt.this.id
}

resource "aws_autoscale_group" "this" {
  lt = data.aws_ld.this.version
}

Does this make sense? Any objections if I implement?

alexjurkiewicz avatar Aug 29 '22 07:08 alexjurkiewicz