Creating a CodeDeploy group to deploy to production

Previously, we created a CodeDeploy application and a first deployment group that allowed us to deploy our code to staging. Using the command-line interface, we are now going to add a new deployment group to deploy our code to our newly created production environment.

One of the parameters needed to add new deployment groups is the arn of the policy we created initially. We can easily extract this from the staging deployment group that we created previously. We will store the result in a variable called arn:

$ arn=$(aws deploy get-deployment-group \    --application-name helloworld \    --deployment-group-name staging \    --query 'deploymentGroupInfo.serviceRoleArn')

We can now run the following ...

Get Effective DevOps with AWS - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.