There are more AWS SDK examples available in the AWS Doc SDK Examples
Use UpdateDeploymentGroup
with an AWS SDK or 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-groupsMy_CodeDeployDemo_ASG
\ --current-deployment-group-nameWordPress_DG
\ --deployment-config-nameCodeDeployDefault.AllAtOnce
\ --ec2-tag-filtersKey=Name,Type=KEY_AND_VALUE,Value=My_CodeDeployDemo
\ --new-deployment-group-nameMy_WordPress_DepGroup
\ --service-role-arnarn:aws:iam::80398EXAMPLE:role/CodeDeployDemo-2
This command produces no output.
-
For API details, see UpdateDeploymentGroup
in AWS CLI Command Reference.
-
- 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"})
-
For API details, see UpdateDeploymentGroup in AWS Tools for PowerShell Cmdlet Reference.
-