Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use UpdateDeploymentGroup with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use UpdateDeploymentGroup with a CLI

The following code examples show how to use UpdateDeploymentGroup.

CLI
AWS CLI

To change information about a deployment group

The following update-deployment-group example changes the settings of a deployment group that is associated with the specified application.

aws deploy update-deployment-group \ --application-name WordPress_App \ --auto-scaling-groups My_CodeDeployDemo_ASG \ --current-deployment-group-name WordPress_DG \ --deployment-config-name CodeDeployDefault.AllAtOnce \ --ec2-tag-filters Key=Name,Type=KEY_AND_VALUE,Value=My_CodeDeployDemo \ --new-deployment-group-name My_WordPress_DepGroup \ --service-role-arn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo-2

This command produces no output.

PowerShell
Tools for PowerShell

Example 1: This example changes the name of the specified deployment group for the specified application.

Update-CDDeploymentGroup -ApplicationName MyNewApplication -CurrentDeploymentGroupName MyNewDeploymentGroup -NewDeploymentGroupName MyNewDeploymentGroup-2

Example 2: This example shows how to specify groups of EC2 instance tags that an instance must be identified by in order for it to be included in the replacement environment for a blue/green deployment.

Update-CDDeploymentGroup -ApplicationName MyNewApplication -CurrentDeploymentGroupName MyNewDeploymentGroup -NewDeploymentGroupName MyNewDeploymentGroup-2 -Ec2TagSetList @(@{Key="key1";Type="KEY_ONLY"},@{Key="Key2";Type="KEY_AND_VALUE";Value="Value2"}),@(@{Key="Key3";Type="VALUE_ONLY";Value="Value3"})
AWS CLI

To change information about a deployment group

The following update-deployment-group example changes the settings of a deployment group that is associated with the specified application.

aws deploy update-deployment-group \ --application-name WordPress_App \ --auto-scaling-groups My_CodeDeployDemo_ASG \ --current-deployment-group-name WordPress_DG \ --deployment-config-name CodeDeployDefault.AllAtOnce \ --ec2-tag-filters Key=Name,Type=KEY_AND_VALUE,Value=My_CodeDeployDemo \ --new-deployment-group-name My_WordPress_DepGroup \ --service-role-arn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo-2

This command produces no output.

PrivacySite termsCookie preferences
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.