- Newest
- Most votes
- Most comments
The way I've commonly seen it done is as follows.
ASG resources are defined in CloudFormation with rolling update of instances, and the template has an "AMI" parameter set to the ID of your custom AMI. When you want to update it to a new AMI ID, run a CloudFormation Stack update with the new value for the AMI parameter. You could trigger the Stack update as soon as your new AMI is available, or have something scheduled that regularly checks for new AMIs for Stacks that have an "AMI" parameter, for example.
BTW Launch Configurations are being deprecated, so best to update to using Launch Templates.
Does this automation template work for you? It uses launch templates instead of launch configs, but otherwise it sounds like what you're asking for: https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-walk-patch-windows-ami-autoscaling.html
Relevant content
- asked a year ago
- asked 5 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago
- I can't use Amazon EC2 Auto Scaling to launch EC2 instances with encrypted AMIs or encrypted volumesAWS OFFICIALUpdated 2 years ago
Thank you for comment. first of all I know Launch Configuration will be deprecated but it will support until I have it, so I won't change yet.
and you told me that I can use run cloudformation Stack update. However, I want to do all the process automatically.
is it possible using cloudformation stack update as automation?