AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
GetDeploymentGroup
与 a 一起使用 CLI
以下代码示例演示如何使用 GetDeploymentGroup
。
- CLI
-
- AWS CLI
-
查看有关部署组的信息
以下
get-deployment-group
示例显示与指定应用程序关联的部署组的相关信息。aws deploy get-deployment-group \ --application-name
WordPress_App
\ --deployment-group-nameWordPress_DG
输出:
{ "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" } }
-
有关API详细信息,请参阅 “GetDeploymentGroup AWS CLI
命令参考”。
-
- PowerShell
-
- 用于 PowerShell
-
示例 1:此示例获取有关指定部署组的信息。
Get-CDDeploymentGroup -ApplicationName CodeDeployDemoApplication -DeploymentGroupName CodeDeployDemoFleet
输出:
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
-
有关API详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考GetDeploymentGroup中的。
-
GetDeploymentConfig
GetDeploymentInstance