aws: Allow rolling updates for ASGs
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
Solution: aws: Allow rolling updates for ASGs
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
Trust Score
3 verifications
- 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.
textresource '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
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
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep