amazon-web-servicesamazon-ec2aws-cloudformationaws-auto-scalinglaunch-configuration

Creating a LaunchConfiguration and updating the ASG


I have a script which is going to create a new LaunchConfiguration with new AMI_ID and retaining all the existing metadata like user_data etc. Then I'm triggering a ASG instance refresh to launch instances with the new LC. What I'm concerned is, as I'm doing things outside of cfn what is going to happen when the cfn stack update gonna happen next time? is this change is going to be considered a drift? just wanted to make sure that this LC creation and updating the ASG don't affect things with CFN.


Solution

  • is this change is going to be considered a drift?

    Yes. You are causing a drift. When you update your stack, the ASG will be reverted back to the state it is in the template, not whatever you made it to be outside of CFN.

    Its not a good practice to manually change your resources outside of CFN. You will have to update your template to match your current ASG state.