Skip to content
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

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

Open
harshitp1987 opened this issue Jul 11, 2022 · 2 comments
Labels
bug 🐛 An issue with the system

Comments

@harshitp1987
Copy link

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 harshitp1987 added the bug 🐛 An issue with the system label Jul 11, 2022
@alexjurkiewicz
Copy link
Contributor

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?

@tirimia
Copy link

tirimia commented May 8, 2023

After trying to solve this issue in my company, I realized the issue lies with the conditional on the version inside the locals launch template block. To get the old behavior, set the var.launch_template_version to an empty string ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

3 participants