FG
☁️ Cloud & DevOps

aws: Allow rolling updates for ASGs

Freshalmost 9 years ago
Mar 14, 20260 views
Confidence Score84%
84%

Problem

Once #1109 is fixed, I'd like to be able to use Terraform to actually roll out the updated launch configuration and do it carefully. Whoever decides to not roll out the update and change the LC association only should still be allowed to do so. Here's an example from CloudFormation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html How about something like this? [code block] then if there's such policy defined, TF can use autoscaling API and shut down each EC2 instance separately and let ASG spin up a new one with an updated LC.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
84% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: aws: Allow rolling updates for ASGs

Low Risk

My experience with code deploy is that it's limited to installing software on running instances...so it can roll out updates to ASG instances but it doesn't know how to do a roll-out by 'terminating' instances like CF does. This would be an awesome feature, but I don't really think it's something that fits into Terraform's current model very well. Perhaps if there was a separate lifecycle type hoo

84

Trust Score

3 verifications

100% success
  1. 1

    My experience with code deploy is that it's limited to installing software on ru

    This would be an awesome feature, but I don't really think it's something that fits into Terraform's current model very well. Perhaps if there was a separate lifecycle type hook that actions could be plugged into.

    text
    resource 'aws_launch_configuration' 'main' {
    }
    
    resource 'aws_autoscaling_group' 'main' {
      lifecycle {
        on_update {
          properties ['launch_configuration']
          actions {
            action 'aws_autoscaling_group_terminate_instances' {
              batch_size = 1
            }
          }
        }
      }
    }
  2. 2

    These actions then could be a whole separate concept in Terraform.

    These actions then could be a whole separate concept in Terraform.

Validation

Resolved in hashicorp/terraform GitHub issue #1552. Community reactions: 2 upvotes.

Verification Summary

Worked: 3
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

terraformiacawsenhancementprovider/aws