There are more AWS SDK examples available in the AWS Doc SDK Examples
Use GetDeploymentGroup
with a CLI
The following code examples show how to use GetDeploymentGroup
.
- CLI
-
- AWS CLI
-
To view information about a deployment group
The following
get-deployment-group
example displays information about a deployment group that is associated with the specified application.aws deploy get-deployment-group \ --application-name
WordPress_App
\ --deployment-group-nameWordPress_DG
Output:
{ "deploymentGroupInfo": { "applicationName": "WordPress_App", "autoScalingGroups": [ "CodeDeployDemo-ASG" ], "deploymentConfigName": "CodeDeployDefault.OneAtATime", "ec2TagFilters": [ { "Type": "KEY_AND_VALUE", "Value": "CodeDeployDemo", "Key": "Name" } ], "deploymentGroupId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE", "serviceRoleArn": "arn:aws:iam::123456789012:role/CodeDeployDemoRole", "deploymentGroupName": "WordPress_DG" } }
-
For API details, see GetDeploymentGroup
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example gets information about the specified deployment group.
Get-CDDeploymentGroup -ApplicationName CodeDeployDemoApplication -DeploymentGroupName CodeDeployDemoFleet
Output:
ApplicationName : CodeDeployDemoApplication AutoScalingGroups : {} DeploymentConfigName : CodeDeployDefault.OneAtATime DeploymentGroupId : 7d7c098a-b444-4b27-96ef-22791EXAMPLE DeploymentGroupName : CodeDeployDemoFleet Ec2TagFilters : {Name} OnPremisesInstanceTagFilters : {} ServiceRoleArn : arn:aws:iam::80398EXAMPLE:role/CodeDeploySampleStack-4ph6EX-CodeDeployTrustRole-O9MWP7XTL8EX TargetRevision : Amazon.CodeDeploy.Model.RevisionLocation
-
For API details, see GetDeploymentGroup in AWS Tools for PowerShell Cmdlet Reference.
-