You can use the CodeDeploy console, the AWS CLI, or the CodeDeploy APIs to change the settings of a deployment group.
Do not use these steps if you want the deployment group to use a not-yet-created custom deployment group. Instead, follow the instructions inCreate a Deployment Configuration, and then return to this topic. Do not use these steps if you want the deployment group to use a different, not-yet-created service role. The service role must trust CodeDeploy with, at minimum, the permissions described inStep 2: Create a service role for CodeDeploy. To create and configure a service role with the correct permissions, follow the instructions inStep 2: Create a service role for CodeDeploy, and then return to this topic.
To use the CodeDeploy console to change deployment group settings:
Sign in to the AWS Management Console and open the CodeDeploy console athttps://console.aws.amazon.com/codedeploy.
Sign in with the same user that you set up inGetting started with CodeDeploy.
In the navigation pane, expandDeploy, then chooseApplications.
In the list of applications, choose the name of the application that is associated with the deployment group you want to change.
If no entries are displayed, make sure the correct region is selected. On the navigation bar, in the region selector, choose one of the regions listed inRegion and Endpoints in theAWS General Reference. CodeDeploy is supported in these regions only.
Choose theDeployment groups tab, and then choose the name of the deployment group you want to change.
On theDepoyment group page, chooseEdit.
Edit the deployment group options as needed.
For information about deployment group components, seeCreate a deployment group with CodeDeploy.
ChooseSave changes.
To use the AWS CLI to change deployment group settings, call theupdate-deployment-group command, specifying:
For EC2/On-Premises and AWS Lambda deployments:
The application name. To view a list of application names, call thelist-applications command.
The current deployment group name. To view a list of deployment group names, call thelist-deployment-groups command.
(Optional) A different deployment group name.
(Optional) A different Amazon Resource Name (ARN) that corresponds to a service role that allows CodeDeploy to act on your AWS account's behalf when interacting with other AWS services. To get the service role ARN, seeGet the service role ARN (CLI). For more information about service roles, seeRoles terms and concepts inIAM User Guide.
(Optional) The name of the deployment configuration. To view a list of deployment configurations, seeView Deployment Configuration Details. (If not specified, CodeDeploy uses a default deployment configuration.)
(Optional) Commands to add one or more existing CloudWatch alarms to the deployment group that are activated if a metric specified in an alarm falls below or exceeds a defined threshold.
(Optional) Commands for a deployment to roll back to the last known good revision when a deployment fails or a CloudWatch alarm is activated.
(Optional) Commands for a deployment to generate lifecycle event hooks during an Auto Scaling scale-in event. For more information, seeHow Amazon EC2 Auto Scaling works with CodeDeploy.
(Optional) Commands to create or update a trigger that publishes to a topic in Amazon Simple Notification Service, so that subscribers to that topic receive notifications about deployment and instance events in this deployment group. For information, seeMonitoring Deployments with Amazon SNS Event Notifications.
For EC2/On-Premises deployments only:
(Optional) Replacement tags or tag groups that uniquely identify the instances to be included in the deployment group.
(Optional) The names of replacement Amazon EC2 Auto Scaling groups to be added to the deployment group.
For Amazon ECS deployments only:
The Amazon ECS service to deploy.
Load balancer information, including the Application Load Balancer or Network Load Balancer, the target groups required for an Amazon ECS deployment, and production and optional test listener information.