Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (5.6k points)
My CloudFormation template creates an autoscaling group with a random name. Now I want to go to the CodeDeploy console and manually add the new autoscaling group to the deployment group and I want to automate this process.

I see two ways to do so:

1. CloudFormation to always assign the autoscaling group the same name and just configure it once in the CodeDeploy.

2. CloudFormation modify CodeDeploy with the new autoscaling group name.

But it seems either of the ways is not allowed, any idea how to do this?

1 Answer

0 votes
by (12.4k points)

Here's what you can try:

  • Put the name of your autoscaling group in the output section of your template.
  • After creating the stack, call describe-stack to retrieve the autoscaling group name from outputs.
  • Use the code deploy API to add the autoscaling group to the deployment group.

You can put this in a simple script, and by doing that, you can easily create as many ad-hoc stacks/stagging environments as per your requirements.

If you are looking forward to master AWS, then do check out AWS Course!!

Refer to the below video tutorial for learning more on AWS CloudFormation.

Browse Categories