terraform-aws-modules / terraform-aws-autoscaling

Terraform module to create AWS Auto Scaling resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws
Apache License 2.0
289 stars 553 forks source link

Renamed launch template not picked up by autoscaling group #202

Closed jstehlik-ohpen closed 1 year ago

jstehlik-ohpen commented 1 year ago

Description

After renaming a launch template created by this module (which causes replacement), the associated autoscaling group does not pick up the new launch template, but references the old one.

Versions

Reproduction Code [Required]

Steps to reproduce the behavior:

  1. Create autoscaling group with launch template
    launch_template_name            = "old-launch-template"
    launch_template_use_name_prefix = false
  2. Rename launch template in module call
    launch_template_name            = "new-launch-template"
    launch_template_use_name_prefix = false

Expected behavior

After renaming launch template (or other change causing replacement) created by this module, autoscaling group uses the new launch template

Actual behavior

After renaming launch template, autoscaling attempts to use the old launch template

Terminal Output Screenshot(s)

# module.ecs_cluster[0].module.asg_linux.aws_autoscaling_group.this[0] will be updated in-place
  ~ resource "aws_autoscaling_group" "this" {
        id                        = "tst-main-ecs-cluster-linux"
        name                      = "tst-main-ecs-cluster-linux"
        # (23 unchanged attributes hidden)

      ~ launch_template {
            id      = "lt-086c081e7ef0e0ffc"
          ~ name    = "tst-main-ecs-cluster-20220801142903803500000001" -> "tst-main-ecs-cluster-linux"
          ~ version = "1" -> (known after apply)
        }

        # (12 unchanged blocks hidden)
    }

# module.ecs_cluster[0].module.asg_linux.aws_launch_template.this[0] must be replaced
+/- resource "aws_launch_template" "this" {
      ~ arn                     = "arn:aws:ec2:***:************:launch-template/lt-086c081e7ef0e0ffc" -> (known after apply)
      ~ default_version         = 1 -> (known after apply)
      - disable_api_stop        = false -> null
      - disable_api_termination = false -> null
      ~ id                      = "lt-086c081e7ef0e0ffc" -> (known after apply)
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

antonbabenko commented 9 months ago

This issue has been resolved in version 7.0.0 :tada: