

Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh [SDK AWS Doc](https://github.com/awsdocs/aws-doc-sdk-examples). GitHub 

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Contoh dasar untuk CodeDeploy menggunakan AWS SDKs
<a name="codedeploy_code_examples_basics"></a>

Contoh kode berikut menunjukkan cara menggunakan dasar-dasar AWS CodeDeploy dengan AWS SDKs. 

**Contents**
+ [Tindakan](codedeploy_code_examples_actions.md)
  + [`AddTagsToOnPremisesInstances`](codedeploy_example_codedeploy_AddTagsToOnPremisesInstances_section.md)
  + [`BatchGetApplications`](codedeploy_example_codedeploy_BatchGetApplications_section.md)
  + [`BatchGetDeployments`](codedeploy_example_codedeploy_BatchGetDeployments_section.md)
  + [`BatchGetOnPremisesInstances`](codedeploy_example_codedeploy_BatchGetOnPremisesInstances_section.md)
  + [`CreateApplication`](codedeploy_example_codedeploy_CreateApplication_section.md)
  + [`CreateDeployment`](codedeploy_example_codedeploy_CreateDeployment_section.md)
  + [`CreateDeploymentConfig`](codedeploy_example_codedeploy_CreateDeploymentConfig_section.md)
  + [`CreateDeploymentGroup`](codedeploy_example_codedeploy_CreateDeploymentGroup_section.md)
  + [`DeleteApplication`](codedeploy_example_codedeploy_DeleteApplication_section.md)
  + [`DeleteDeploymentConfig`](codedeploy_example_codedeploy_DeleteDeploymentConfig_section.md)
  + [`DeleteDeploymentGroup`](codedeploy_example_codedeploy_DeleteDeploymentGroup_section.md)
  + [`DeregisterOnPremisesInstance`](codedeploy_example_codedeploy_DeregisterOnPremisesInstance_section.md)
  + [`GetApplication`](codedeploy_example_codedeploy_GetApplication_section.md)
  + [`GetApplicationRevision`](codedeploy_example_codedeploy_GetApplicationRevision_section.md)
  + [`GetDeployment`](codedeploy_example_codedeploy_GetDeployment_section.md)
  + [`GetDeploymentConfig`](codedeploy_example_codedeploy_GetDeploymentConfig_section.md)
  + [`GetDeploymentGroup`](codedeploy_example_codedeploy_GetDeploymentGroup_section.md)
  + [`GetDeploymentInstance`](codedeploy_example_codedeploy_GetDeploymentInstance_section.md)
  + [`GetOnPremisesInstance`](codedeploy_example_codedeploy_GetOnPremisesInstance_section.md)
  + [`ListApplicationRevisions`](codedeploy_example_codedeploy_ListApplicationRevisions_section.md)
  + [`ListApplications`](codedeploy_example_codedeploy_ListApplications_section.md)
  + [`ListDeploymentConfigs`](codedeploy_example_codedeploy_ListDeploymentConfigs_section.md)
  + [`ListDeploymentGroups`](codedeploy_example_codedeploy_ListDeploymentGroups_section.md)
  + [`ListDeploymentInstances`](codedeploy_example_codedeploy_ListDeploymentInstances_section.md)
  + [`ListDeployments`](codedeploy_example_codedeploy_ListDeployments_section.md)
  + [`ListOnPremisesInstances`](codedeploy_example_codedeploy_ListOnPremisesInstances_section.md)
  + [`RegisterApplicationRevision`](codedeploy_example_codedeploy_RegisterApplicationRevision_section.md)
  + [`RegisterOnPremisesInstance`](codedeploy_example_codedeploy_RegisterOnPremisesInstance_section.md)
  + [`RemoveTagsFromOnPremisesInstances`](codedeploy_example_codedeploy_RemoveTagsFromOnPremisesInstances_section.md)
  + [`StopDeployment`](codedeploy_example_codedeploy_StopDeployment_section.md)
  + [`UpdateApplication`](codedeploy_example_codedeploy_UpdateApplication_section.md)
  + [`UpdateDeploymentGroup`](codedeploy_example_codedeploy_UpdateDeploymentGroup_section.md)

# Tindakan untuk CodeDeploy menggunakan AWS SDKs
<a name="codedeploy_code_examples_actions"></a>

Contoh kode berikut menunjukkan bagaimana melakukan CodeDeploy tindakan individu dengan AWS SDKs. Setiap contoh menyertakan tautan ke GitHub, di mana Anda dapat menemukan instruksi untuk mengatur dan menjalankan kode. 

 Contoh berikut hanya mencakup tindakan yang paling umum digunakan. Untuk daftar lengkapnya, lihat [Referensi AWS CodeDeploy API](https://docs.aws.amazon.com/codedeploy/latest/APIReference/Welcome.html). 

**Topics**
+ [`AddTagsToOnPremisesInstances`](codedeploy_example_codedeploy_AddTagsToOnPremisesInstances_section.md)
+ [`BatchGetApplications`](codedeploy_example_codedeploy_BatchGetApplications_section.md)
+ [`BatchGetDeployments`](codedeploy_example_codedeploy_BatchGetDeployments_section.md)
+ [`BatchGetOnPremisesInstances`](codedeploy_example_codedeploy_BatchGetOnPremisesInstances_section.md)
+ [`CreateApplication`](codedeploy_example_codedeploy_CreateApplication_section.md)
+ [`CreateDeployment`](codedeploy_example_codedeploy_CreateDeployment_section.md)
+ [`CreateDeploymentConfig`](codedeploy_example_codedeploy_CreateDeploymentConfig_section.md)
+ [`CreateDeploymentGroup`](codedeploy_example_codedeploy_CreateDeploymentGroup_section.md)
+ [`DeleteApplication`](codedeploy_example_codedeploy_DeleteApplication_section.md)
+ [`DeleteDeploymentConfig`](codedeploy_example_codedeploy_DeleteDeploymentConfig_section.md)
+ [`DeleteDeploymentGroup`](codedeploy_example_codedeploy_DeleteDeploymentGroup_section.md)
+ [`DeregisterOnPremisesInstance`](codedeploy_example_codedeploy_DeregisterOnPremisesInstance_section.md)
+ [`GetApplication`](codedeploy_example_codedeploy_GetApplication_section.md)
+ [`GetApplicationRevision`](codedeploy_example_codedeploy_GetApplicationRevision_section.md)
+ [`GetDeployment`](codedeploy_example_codedeploy_GetDeployment_section.md)
+ [`GetDeploymentConfig`](codedeploy_example_codedeploy_GetDeploymentConfig_section.md)
+ [`GetDeploymentGroup`](codedeploy_example_codedeploy_GetDeploymentGroup_section.md)
+ [`GetDeploymentInstance`](codedeploy_example_codedeploy_GetDeploymentInstance_section.md)
+ [`GetOnPremisesInstance`](codedeploy_example_codedeploy_GetOnPremisesInstance_section.md)
+ [`ListApplicationRevisions`](codedeploy_example_codedeploy_ListApplicationRevisions_section.md)
+ [`ListApplications`](codedeploy_example_codedeploy_ListApplications_section.md)
+ [`ListDeploymentConfigs`](codedeploy_example_codedeploy_ListDeploymentConfigs_section.md)
+ [`ListDeploymentGroups`](codedeploy_example_codedeploy_ListDeploymentGroups_section.md)
+ [`ListDeploymentInstances`](codedeploy_example_codedeploy_ListDeploymentInstances_section.md)
+ [`ListDeployments`](codedeploy_example_codedeploy_ListDeployments_section.md)
+ [`ListOnPremisesInstances`](codedeploy_example_codedeploy_ListOnPremisesInstances_section.md)
+ [`RegisterApplicationRevision`](codedeploy_example_codedeploy_RegisterApplicationRevision_section.md)
+ [`RegisterOnPremisesInstance`](codedeploy_example_codedeploy_RegisterOnPremisesInstance_section.md)
+ [`RemoveTagsFromOnPremisesInstances`](codedeploy_example_codedeploy_RemoveTagsFromOnPremisesInstances_section.md)
+ [`StopDeployment`](codedeploy_example_codedeploy_StopDeployment_section.md)
+ [`UpdateApplication`](codedeploy_example_codedeploy_UpdateApplication_section.md)
+ [`UpdateDeploymentGroup`](codedeploy_example_codedeploy_UpdateDeploymentGroup_section.md)

# Gunakan `AddTagsToOnPremisesInstances` dengan CLI
<a name="codedeploy_example_codedeploy_AddTagsToOnPremisesInstances_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`AddTagsToOnPremisesInstances`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk menambahkan tag ke instance lokal**  
`add-tags-to-on-premises-instances`Contoh berikut mengaitkan tag instans lokal yang sama ke dua instance lokal. AWS CodeDeploy Itu tidak mendaftarkan instance lokal dengan. AWS CodeDeploy  

```
aws deploy add-tags-to-on-premises-instances \
    --instance-names AssetTag12010298EX AssetTag23121309EX \
    --tags Key=Name,Value=CodeDeployDemo-OnPrem
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [AddTagsToOnPremisesInstances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/add-tags-to-on-premises-instances.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menambahkan tag instans lokal dengan kunci dan nilai yang ditentukan untuk instans lokal yang ditentukan.**  

```
Add-CDOnPremiseInstanceTag -InstanceName AssetTag12010298EX -Tag @{"Key" = "Name"; "Value" = "CodeDeployDemo-OnPrem"}
```
+  Untuk detail API, lihat [AddTagsToOnPremisesInstances](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menambahkan tag instans lokal dengan kunci dan nilai yang ditentukan untuk instans lokal yang ditentukan.**  

```
Add-CDOnPremiseInstanceTag -InstanceName AssetTag12010298EX -Tag @{"Key" = "Name"; "Value" = "CodeDeployDemo-OnPrem"}
```
+  Untuk detail API, lihat [AddTagsToOnPremisesInstances](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `BatchGetApplications` dengan CLI
<a name="codedeploy_example_codedeploy_BatchGetApplications_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`BatchGetApplications`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang beberapa aplikasi**  
`batch-get-applications`Contoh berikut menampilkan informasi tentang beberapa aplikasi yang terkait dengan AWS akun pengguna.  

```
aws deploy batch-get-applications --application-names WordPress_App MyOther_App
```
Output:  

```
{
    "applicationsInfo": [
        {
            "applicationName": "WordPress_App",
            "applicationId": "d9dd6993-f171-44fa-a811-211e4EXAMPLE",
            "createTime": 1407878168.078,
            "linkedToGitHub": false
        },
        {
            "applicationName": "MyOther_App",
            "applicationId": "8ca57519-31da-42b2-9194-8bb16EXAMPLE",
            "createTime": 1407453571.63,
            "linkedToGitHub": false
        }
    ]
}
```
+  Untuk detail API, lihat [BatchGetApplications](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/batch-get-applications.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang aplikasi yang ditentukan.**  

```
Get-CDApplicationBatch -ApplicationName CodeDeployDemoApplication, CodePipelineDemoApplication
```
**Output:**  

```
ApplicationId                           ApplicationName              CreateTime              LinkedToGitHub
-------------                           ---------------              ----------              --------------
e07fb938-091e-4f2f-8963-4d3e8EXAMPLE    CodeDeployDemoApplication    7/20/2015 9:49:48 PM    False
1ecfd602-62f1-4038-8f0d-06688EXAMPLE    CodePipelineDemoApplication  8/13/2015 5:53:26 PM    False
```
+  Untuk detail API, lihat [BatchGetApplications](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang aplikasi yang ditentukan.**  

```
Get-CDApplicationBatch -ApplicationName CodeDeployDemoApplication, CodePipelineDemoApplication
```
**Output:**  

```
ApplicationId                           ApplicationName              CreateTime              LinkedToGitHub
-------------                           ---------------              ----------              --------------
e07fb938-091e-4f2f-8963-4d3e8EXAMPLE    CodeDeployDemoApplication    7/20/2015 9:49:48 PM    False
1ecfd602-62f1-4038-8f0d-06688EXAMPLE    CodePipelineDemoApplication  8/13/2015 5:53:26 PM    False
```
+  Untuk detail API, lihat [BatchGetApplications](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `BatchGetDeployments` dengan CLI
<a name="codedeploy_example_codedeploy_BatchGetDeployments_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`BatchGetDeployments`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang beberapa penerapan**  
`batch-get-deployments`Contoh berikut menampilkan informasi tentang beberapa penerapan yang terkait dengan akun pengguna. AWS   

```
aws deploy batch-get-deployments --deployment-ids d-A1B2C3111 d-A1B2C3222
```
Output:  

```
{
    "deploymentsInfo": [
        {
            "applicationName": "WordPress_App",
            "status": "Failed",
            "deploymentOverview": {
                "Failed": 0,
                "InProgress": 0,
                "Skipped": 0,
                "Succeeded": 1,
                "Pending": 0
            },
            "deploymentConfigName": "CodeDeployDefault.OneAtATime",
            "creator": "user",
            "deploymentGroupName": "WordPress_DG",
            "revision": {
                "revisionType": "S3",
                "s3Location": {
                "bundleType": "zip",
                "version": "uTecLusEXAMPLEFXtfUcyfV8bEXAMPLE",
                "bucket": "amzn-s3-demo-bucket",
                "key": "WordPressApp.zip"
                }
            },
            "deploymentId": "d-A1B2C3111",
            "createTime": 1408480721.9,
            "completeTime": 1408480741.822
        },
        {
            "applicationName": "MyOther_App",
            "status": "Failed",
            "deploymentOverview": {
                "Failed": 1,
                "InProgress": 0,
                "Skipped": 0,
                "Succeeded": 0,
                "Pending": 0
            },
            "deploymentConfigName": "CodeDeployDefault.OneAtATime",
            "creator": "user",
            "errorInformation": {
                "message": "Deployment failed: Constraint default violated: No hosts succeeded.",
                "code": "HEALTH_CONSTRAINTS"
            },
            "deploymentGroupName": "MyOther_DG",
            "revision": {
                "revisionType": "S3",
                "s3Location": {
                "bundleType": "zip",
                "eTag": "\"dd56cfdEXAMPLE8e768f9d77fEXAMPLE\"",
                "bucket": "amzn-s3-demo-bucket",
                "key": "MyOtherApp.zip"
                }
            },
            "deploymentId": "d-A1B2C3222",
            "createTime": 1409764576.589,
            "completeTime": 1409764596.101
        }
    ]
}
```
+  Untuk detail API, lihat [BatchGetDeployments](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/batch-get-deployments.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang penerapan yang ditentukan.**  

```
Get-CDDeploymentBatch -DeploymentId d-QZMRGSTEX, d-RR0T5KTEX
```
**Output:**  

```
ApplicationName               : CodeDeployDemoApplication
CompleteTime                  : 7/23/2015 11:26:04 PM
CreateTime                    : 7/23/2015 11:24:43 PM
Creator                       : user
DeploymentConfigName          : CodeDeployDefault.OneAtATime
DeploymentGroupName           : CodeDeployDemoFleet
DeploymentId                  : d-QZMRGSTEX
DeploymentOverview            : Amazon.CodeDeploy.Model.DeploymentOverview
Description                   :
ErrorInformation              :
IgnoreApplicationStopFailures : False
Revision                      : Amazon.CodeDeploy.Model.RevisionLocation
StartTime                     : 1/1/0001 12:00:00 AM
Status                        : Succeeded

ApplicationName               : CodePipelineDemoApplication
CompleteTime                  : 7/23/2015 6:07:30 PM
CreateTime                    : 7/23/2015 6:06:29 PM
Creator                       : user
DeploymentConfigName          : CodeDeployDefault.OneAtATime
DeploymentGroupName           : CodePipelineDemoFleet
DeploymentId                  : d-RR0T5KTEX
DeploymentOverview            : Amazon.CodeDeploy.Model.DeploymentOverview
Description                   :
ErrorInformation              :
IgnoreApplicationStopFailures : False
Revision                      : Amazon.CodeDeploy.Model.RevisionLocation
StartTime                     : 1/1/0001 12:00:00 AM
Status                        : Succeeded
```
+  Untuk detail API, lihat [BatchGetDeployments](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang penerapan yang ditentukan.**  

```
Get-CDDeploymentBatch -DeploymentId d-QZMRGSTEX, d-RR0T5KTEX
```
**Output:**  

```
ApplicationName               : CodeDeployDemoApplication
CompleteTime                  : 7/23/2015 11:26:04 PM
CreateTime                    : 7/23/2015 11:24:43 PM
Creator                       : user
DeploymentConfigName          : CodeDeployDefault.OneAtATime
DeploymentGroupName           : CodeDeployDemoFleet
DeploymentId                  : d-QZMRGSTEX
DeploymentOverview            : Amazon.CodeDeploy.Model.DeploymentOverview
Description                   :
ErrorInformation              :
IgnoreApplicationStopFailures : False
Revision                      : Amazon.CodeDeploy.Model.RevisionLocation
StartTime                     : 1/1/0001 12:00:00 AM
Status                        : Succeeded

ApplicationName               : CodePipelineDemoApplication
CompleteTime                  : 7/23/2015 6:07:30 PM
CreateTime                    : 7/23/2015 6:06:29 PM
Creator                       : user
DeploymentConfigName          : CodeDeployDefault.OneAtATime
DeploymentGroupName           : CodePipelineDemoFleet
DeploymentId                  : d-RR0T5KTEX
DeploymentOverview            : Amazon.CodeDeploy.Model.DeploymentOverview
Description                   :
ErrorInformation              :
IgnoreApplicationStopFailures : False
Revision                      : Amazon.CodeDeploy.Model.RevisionLocation
StartTime                     : 1/1/0001 12:00:00 AM
Status                        : Succeeded
```
+  Untuk detail API, lihat [BatchGetDeployments](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `BatchGetOnPremisesInstances` dengan CLI
<a name="codedeploy_example_codedeploy_BatchGetOnPremisesInstances_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`BatchGetOnPremisesInstances`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang satu atau beberapa instans lokal**  
`batch-get-on-premises-instances`Contoh berikut mendapatkan informasi tentang dua instance lokal.  

```
aws deploy batch-get-on-premises-instances --instance-names AssetTag12010298EX AssetTag23121309EX
```
Output:  

```
{
    "instanceInfos": [
        {
            "iamUserArn": "arn:aws:iam::123456789012:user/AWS/CodeDeploy/AssetTag12010298EX",
            "tags": [
                {
                    "Value": "CodeDeployDemo-OnPrem",
                    "Key": "Name"
                }
            ],
            "instanceName": "AssetTag12010298EX",
            "registerTime": 1425579465.228,
            "instanceArn": "arn:aws:codedeploy:us-west-2:123456789012:instance/AssetTag12010298EX_4IwLNI2Alh"
        },
        {
            "iamUserArn": "arn:aws:iam::123456789012:user/AWS/CodeDeploy/AssetTag23121309EX",
            "tags": [
                {
                    "Value": "CodeDeployDemo-OnPrem",
                    "Key": "Name"
                }
            ],
            "instanceName": "AssetTag23121309EX",
            "registerTime": 1425595585.988,
            "instanceArn": "arn:aws:codedeploy:us-west-2:80398EXAMPLE:instance/AssetTag23121309EX_PomUy64Was"
        }
    ]
}
```
+  Untuk detail API, lihat [BatchGetOnPremisesInstances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/batch-get-on-premises-instances.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang instance lokal yang ditentukan.**  

```
Get-CDOnPremiseInstanceBatch -InstanceName AssetTag12010298EX, AssetTag12010298EX-2
```
**Output:**  

```
DeregisterTime : 1/1/0001 12:00:00 AM
IamUserArn     : arn:aws:iam::80398EXAMPLE:user/CodeDeployFRWUser
InstanceArn    : arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX-2_XmeSz18rEX
InstanceName   : AssetTag12010298EX-2
RegisterTime   : 4/3/2015 6:38:52 PM
Tags           : {Name}

DeregisterTime : 1/1/0001 12:00:00 AM
IamUserArn     : arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser
InstanceArn    : arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX_rDH556dxEX
InstanceName   : AssetTag12010298EX
RegisterTime   : 4/3/2015 6:36:24 PM
Tags           : {Name}
```
+  Untuk detail API, lihat [BatchGetOnPremisesInstances](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang instance lokal yang ditentukan.**  

```
Get-CDOnPremiseInstanceBatch -InstanceName AssetTag12010298EX, AssetTag12010298EX-2
```
**Output:**  

```
DeregisterTime : 1/1/0001 12:00:00 AM
IamUserArn     : arn:aws:iam::80398EXAMPLE:user/CodeDeployFRWUser
InstanceArn    : arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX-2_XmeSz18rEX
InstanceName   : AssetTag12010298EX-2
RegisterTime   : 4/3/2015 6:38:52 PM
Tags           : {Name}

DeregisterTime : 1/1/0001 12:00:00 AM
IamUserArn     : arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser
InstanceArn    : arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX_rDH556dxEX
InstanceName   : AssetTag12010298EX
RegisterTime   : 4/3/2015 6:36:24 PM
Tags           : {Name}
```
+  Untuk detail API, lihat [BatchGetOnPremisesInstances](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `CreateApplication` dengan CLI
<a name="codedeploy_example_codedeploy_CreateApplication_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`CreateApplication`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk membuat aplikasi**  
`create-application`Contoh berikut membuat aplikasi dan mengaitkannya dengan AWS akun pengguna.  

```
aws deploy create-application --application-name MyOther_App
```
Output:  

```
{
    "applicationId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE"
}
```
+  Untuk detail API, lihat [CreateApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/create-application.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini membuat aplikasi baru dengan nama yang ditentukan.**  

```
New-CDApplication -ApplicationName MyNewApplication
```
**Output:**  

```
f19e4b61-2231-4328-b0fd-e57f5EXAMPLE
```
+  Untuk detail API, lihat [CreateApplication](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat aplikasi baru dengan nama yang ditentukan.**  

```
New-CDApplication -ApplicationName MyNewApplication
```
**Output:**  

```
f19e4b61-2231-4328-b0fd-e57f5EXAMPLE
```
+  Untuk detail API, lihat [CreateApplication](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `CreateDeployment` dengan CLI
<a name="codedeploy_example_codedeploy_CreateDeployment_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`CreateDeployment`.

------
#### [ CLI ]

**AWS CLI**  
**Contoh 1: Untuk membuat CodeDeploy penerapan menggunakan platform komputasi EC2/On-premise**  
`create-deployment`Contoh berikut membuat penyebaran dan mengaitkannya dengan akun pengguna. AWS   

```
aws deploy create-deployment \
    --application-name WordPress_App \
    --deployment-config-name CodeDeployDefault.OneAtATime \
    --deployment-group-name WordPress_DG \
    --description "My demo deployment" \
    --s3-location bucket=amzn-s3-demo-bucket,bundleType=zip,eTag=dd56cfdEXAMPLE8e768f9d77fEXAMPLE,key=WordPressApp.zip
```
Output:  

```
{
    "deploymentId": "d-A1B2C3111"
}
```
**Contoh 2: Untuk membuat CodeDeploy penerapan menggunakan platform komputasi Amazon ECS**  
`create-deployment`Contoh berikut menggunakan dua file berikut untuk menyebarkan layanan Amazon ECS.  
Isi `create-deployment.json` file:  

```
{
    "applicationName": "ecs-deployment",
    "deploymentGroupName": "ecs-deployment-dg",
    "revision": {
        "revisionType": "S3",
        "s3Location": {
            "bucket": "ecs-deployment-bucket",
            "key": "appspec.yaml",
            "bundleType": "YAML"
        }
    }
}
```
File itu, pada gilirannya, mengambil file berikut `appspec.yaml` dari bucket S3 yang disebut. `ecs-deployment-bucket`  

```
version: 0.0
Resources:
  - TargetService:
      Type: AWS::ECS::Service
      Properties:
        TaskDefinition: "arn:aws:ecs:region:123456789012:task-definition/ecs-task-def:2"
        LoadBalancerInfo:
          ContainerName: "sample-app"
          ContainerPort: 80
        PlatformVersion: "LATEST"
```
Perintah:  

```
aws deploy create-deployment \
    --cli-input-json file://create-deployment.json \
    --region us-east-1
```
Output:  

```
{
    "deploymentId": "d-1234ABCDE"
}
```
Untuk informasi selengkapnya, lihat [CreateDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html) di dalam *Referensi API AWS CodeDeploy *.   
+  Untuk detail API, lihat [CreateDeployment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/create-deployment.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini membuat penyebaran baru untuk grup aplikasi dan penyebaran yang ditentukan dengan konfigurasi penerapan dan revisi aplikasi yang ditentukan.**  

```
New-CDDeployment -ApplicationName MyNewApplication -S3Location_Bucket amzn-s3-demo-bucket -S3Location_BundleType zip -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -IgnoreApplicationStopFailures $True -S3Location_Key aws-codedeploy_linux-master.zip -RevisionType S3
```
**Output:**  

```
d-ZHROG7UEX
```
**Contoh 2: Contoh ini menunjukkan cara menentukan grup tag instans EC2 yang harus diidentifikasi oleh sebuah instance agar dapat disertakan dalam lingkungan pengganti untuk blue/green penerapan.**  

```
New-CDDeployment -ApplicationName MyNewApplication -S3Location_Bucket amzn-s3-demo-bucket -S3Location_BundleType zip -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -IgnoreApplicationStopFailures $True -S3Location_Key aws-codedeploy_linux-master.zip -RevisionType S3 -Ec2TagSetList @(@{Key="key1";Type="KEY_ONLY"},@{Key="Key2";Type="KEY_AND_VALUE";Value="Value2"}),@(@{Key="Key3";Type="VALUE_ONLY";Value="Value3"})
```
**Output:**  

```
d-ZHROG7UEX
```
+  Untuk detail API, lihat [CreateDeployment](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat penyebaran baru untuk grup aplikasi dan penyebaran yang ditentukan dengan konfigurasi penerapan dan revisi aplikasi yang ditentukan.**  

```
New-CDDeployment -ApplicationName MyNewApplication -S3Location_Bucket amzn-s3-demo-bucket -S3Location_BundleType zip -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -IgnoreApplicationStopFailures $True -S3Location_Key aws-codedeploy_linux-master.zip -RevisionType S3
```
**Output:**  

```
d-ZHROG7UEX
```
**Contoh 2: Contoh ini menunjukkan cara menentukan grup tag instans EC2 yang harus diidentifikasi oleh sebuah instance agar dapat disertakan dalam lingkungan pengganti untuk blue/green penerapan.**  

```
New-CDDeployment -ApplicationName MyNewApplication -S3Location_Bucket amzn-s3-demo-bucket -S3Location_BundleType zip -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -IgnoreApplicationStopFailures $True -S3Location_Key aws-codedeploy_linux-master.zip -RevisionType S3 -Ec2TagSetList @(@{Key="key1";Type="KEY_ONLY"},@{Key="Key2";Type="KEY_AND_VALUE";Value="Value2"}),@(@{Key="Key3";Type="VALUE_ONLY";Value="Value3"})
```
**Output:**  

```
d-ZHROG7UEX
```
+  Untuk detail API, lihat [CreateDeployment](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `CreateDeploymentConfig` dengan CLI
<a name="codedeploy_example_codedeploy_CreateDeploymentConfig_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`CreateDeploymentConfig`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk membuat konfigurasi penerapan kustom**  
`create-deployment-config`Contoh berikut membuat konfigurasi penerapan kustom dan mengaitkannya dengan akun pengguna. AWS   

```
aws deploy create-deployment-config \
    --deployment-config-name ThreeQuartersHealthy \
    --minimum-healthy-hosts type=FLEET_PERCENT,value=75
```
Output:  

```
{
    "deploymentConfigId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE"
}
```
+  Untuk detail API, lihat [CreateDeploymentConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/create-deployment-config.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini membuat konfigurasi penerapan baru dengan nama dan perilaku yang ditentukan.**  

```
New-CDDeploymentConfig -DeploymentConfigName AtLeastTwoHealthyHosts -MinimumHealthyHosts_Type HOST_COUNT -MinimumHealthyHosts_Value 2
```
**Output:**  

```
0f3e8187-44ef-42da-aeed-b6823EXAMPLE
```
+  Untuk detail API, lihat [CreateDeploymentConfig](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat konfigurasi penerapan baru dengan nama dan perilaku yang ditentukan.**  

```
New-CDDeploymentConfig -DeploymentConfigName AtLeastTwoHealthyHosts -MinimumHealthyHosts_Type HOST_COUNT -MinimumHealthyHosts_Value 2
```
**Output:**  

```
0f3e8187-44ef-42da-aeed-b6823EXAMPLE
```
+  Untuk detail API, lihat [CreateDeploymentConfig](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `CreateDeploymentGroup` dengan CLI
<a name="codedeploy_example_codedeploy_CreateDeploymentGroup_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`CreateDeploymentGroup`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk membuat grup penyebaran**  
`create-deployment-group`Contoh berikut membuat grup penyebaran dan mengaitkannya dengan aplikasi yang ditentukan dan akun pengguna. AWS   

```
aws deploy create-deployment-group \
    --application-name WordPress_App \
    --auto-scaling-groups CodeDeployDemo-ASG \
    --deployment-config-name CodeDeployDefault.OneAtATime \
    --deployment-group-name WordPress_DG \
    --ec2-tag-filters Key=Name,Value=CodeDeployDemo,Type=KEY_AND_VALUE \
    --service-role-arn arn:aws:iam::123456789012:role/CodeDeployDemoRole
```
Output:  

```
{
    "deploymentGroupId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE"
}
```
+  Untuk detail API, lihat [CreateDeploymentGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/create-deployment-group.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini membuat grup penyebaran dengan nama yang ditentukan, grup Auto Scaling, konfigurasi penerapan, tag, dan peran layanan, untuk aplikasi yang ditentukan.**  

```
New-CDDeploymentGroup -ApplicationName MyNewApplication -AutoScalingGroup CodeDeployDemo-ASG -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -Ec2TagFilter @{Key="Name"; Type="KEY_AND_VALUE"; Value="CodeDeployDemo"} -ServiceRoleArn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo
```
**Output:**  

```
16bbf199-95fd-40fc-a909-0bbcfEXAMPLE
```
**Contoh 2: Contoh ini menunjukkan cara menentukan grup tag instans EC2 yang harus diidentifikasi oleh sebuah instance agar dapat disertakan dalam lingkungan pengganti untuk blue/green penerapan.**  

```
New-CDDeploymentGroup -ApplicationName MyNewApplication -AutoScalingGroup CodeDeployDemo-ASG -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -Ec2TagFilter @{Key="Name"; Type="KEY_AND_VALUE"; Value="CodeDeployDemo"} -ServiceRoleArn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo -Ec2TagSetList @(@{Key="key1";Type="KEY_ONLY"},@{Key="Key2";Type="KEY_AND_VALUE";Value="Value2"}),@(@{Key="Key3";Type="VALUE_ONLY";Value="Value3"})
```
**Output:**  

```
16bbf199-95fd-40fc-a909-0bbcfEXAMPLE
```
+  Untuk detail API, lihat [CreateDeploymentGroup](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membuat grup penyebaran dengan nama yang ditentukan, grup Auto Scaling, konfigurasi penerapan, tag, dan peran layanan, untuk aplikasi yang ditentukan.**  

```
New-CDDeploymentGroup -ApplicationName MyNewApplication -AutoScalingGroup CodeDeployDemo-ASG -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -Ec2TagFilter @{Key="Name"; Type="KEY_AND_VALUE"; Value="CodeDeployDemo"} -ServiceRoleArn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo
```
**Output:**  

```
16bbf199-95fd-40fc-a909-0bbcfEXAMPLE
```
**Contoh 2: Contoh ini menunjukkan cara menentukan grup tag instans EC2 yang harus diidentifikasi oleh sebuah instance agar dapat disertakan dalam lingkungan pengganti untuk blue/green penerapan.**  

```
New-CDDeploymentGroup -ApplicationName MyNewApplication -AutoScalingGroup CodeDeployDemo-ASG -DeploymentConfigName CodeDeployDefault.OneAtATime -DeploymentGroupName MyNewDeploymentGroup -Ec2TagFilter @{Key="Name"; Type="KEY_AND_VALUE"; Value="CodeDeployDemo"} -ServiceRoleArn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo -Ec2TagSetList @(@{Key="key1";Type="KEY_ONLY"},@{Key="Key2";Type="KEY_AND_VALUE";Value="Value2"}),@(@{Key="Key3";Type="VALUE_ONLY";Value="Value3"})
```
**Output:**  

```
16bbf199-95fd-40fc-a909-0bbcfEXAMPLE
```
+  Untuk detail API, lihat [CreateDeploymentGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `DeleteApplication` dengan CLI
<a name="codedeploy_example_codedeploy_DeleteApplication_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`DeleteApplication`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk menghapus aplikasi**  
`delete-application`Contoh berikut menghapus aplikasi tertentu yang dikaitkan dengan AWS akun pengguna.  

```
aws deploy delete-application --application-name WordPress_App
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [DeleteApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/delete-application.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menghapus aplikasi dengan nama yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus aplikasi tanpa prompt.**  

```
Remove-CDApplication -ApplicationName MyNewApplication
```
+  Untuk detail API, lihat [DeleteApplication](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus aplikasi dengan nama yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus aplikasi tanpa prompt.**  

```
Remove-CDApplication -ApplicationName MyNewApplication
```
+  Untuk detail API, lihat [DeleteApplication](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `DeleteDeploymentConfig` dengan CLI
<a name="codedeploy_example_codedeploy_DeleteDeploymentConfig_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`DeleteDeploymentConfig`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk menghapus konfigurasi penerapan**  
`delete-deployment-config`Contoh berikut menghapus konfigurasi penerapan kustom yang dikaitkan dengan akun pengguna. AWS   

```
aws deploy delete-deployment-config --deployment-config-name ThreeQuartersHealthy
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [DeleteDeploymentConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/delete-deployment-config.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menghapus konfigurasi penerapan dengan nama yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus konfigurasi penerapan tanpa prompt.**  

```
Remove-CDDeploymentConfig -DeploymentConfigName AtLeastTwoHealthyHosts
```
+  Untuk detail API, lihat [DeleteDeploymentConfig](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus konfigurasi penerapan dengan nama yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus konfigurasi penerapan tanpa prompt.**  

```
Remove-CDDeploymentConfig -DeploymentConfigName AtLeastTwoHealthyHosts
```
+  Untuk detail API, lihat [DeleteDeploymentConfig](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `DeleteDeploymentGroup` dengan CLI
<a name="codedeploy_example_codedeploy_DeleteDeploymentGroup_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`DeleteDeploymentGroup`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk menghapus grup penyebaran**  
`delete-deployment-group`Contoh berikut menghapus grup penyebaran yang terkait dengan aplikasi yang ditentukan.  

```
aws deploy delete-deployment-group \
    --application-name WordPress_App \
    --deployment-group-name WordPress_DG
```
Output:  

```
{
    "hooksNotCleanedUp": []
}
```
+  Untuk detail API, lihat [DeleteDeploymentGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/delete-deployment-group.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menghapus grup penyebaran dengan nama yang ditentukan untuk aplikasi yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus grup penyebaran tanpa prompt.**  

```
Remove-CDDeploymentGroup -ApplicationName MyNewApplication -DeploymentGroupName MyNewDeploymentGroup
```
+  Untuk detail API, lihat [DeleteDeploymentGroup](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus grup penyebaran dengan nama yang ditentukan untuk aplikasi yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus grup penyebaran tanpa prompt.**  

```
Remove-CDDeploymentGroup -ApplicationName MyNewApplication -DeploymentGroupName MyNewDeploymentGroup
```
+  Untuk detail API, lihat [DeleteDeploymentGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `DeregisterOnPremisesInstance` dengan CLI
<a name="codedeploy_example_codedeploy_DeregisterOnPremisesInstance_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`DeregisterOnPremisesInstance`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk membatalkan pendaftaran instans lokal**  
`deregister-on-premises-instance`Contoh berikut membatalkan pendaftaran instans lokal dengan AWS CodeDeploy, tetapi tidak menghapus pengguna IAM yang terkait dengan instance, juga tidak memisahkan tag instans lokal AWS CodeDeploy dari instance. Itu juga tidak menghapus Instalasi AWS CodeDeploy Agen dari instance atau menghapus file konfigurasi lokal dari instance.  

```
aws deploy deregister-on-premises-instance --instance-name AssetTag12010298EX
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [DeregisterOnPremisesInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/deregister-on-premises-instance.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini membatalkan pendaftaran instans lokal dengan nama yang ditentukan.**  

```
Unregister-CDOnPremiseInstance -InstanceName AssetTag12010298EX
```
+  Untuk detail API, lihat [DeregisterOnPremisesInstance](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini membatalkan pendaftaran instans lokal dengan nama yang ditentukan.**  

```
Unregister-CDOnPremiseInstance -InstanceName AssetTag12010298EX
```
+  Untuk detail API, lihat [DeregisterOnPremisesInstance](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `GetApplication` dengan CLI
<a name="codedeploy_example_codedeploy_GetApplication_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`GetApplication`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang aplikasi**  
`get-application`Contoh berikut menampilkan informasi tentang aplikasi yang terkait dengan AWS akun pengguna.  

```
aws deploy get-application --application-name WordPress_App
```
Output:  

```
{
    "application": {
        "applicationName": "WordPress_App",
        "applicationId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
        "createTime": 1407878168.078,
        "linkedToGitHub": false
    }
}
```
+  Untuk detail API, lihat [GetApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-application.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang aplikasi yang ditentukan.**  

```
Get-CDApplication -ApplicationName CodeDeployDemoApplication
```
**Output:**  

```
ApplicationId                           ApplicationName              CreateTime              LinkedToGitHub
-------------                           ---------------              ----------              --------------
e07fb938-091e-4f2f-8963-4d3e8EXAMPLE    CodeDeployDemoApplication    7/20/2015 9:49:48 PM    False
```
+  Untuk detail API, lihat [GetApplication](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang aplikasi yang ditentukan.**  

```
Get-CDApplication -ApplicationName CodeDeployDemoApplication
```
**Output:**  

```
ApplicationId                           ApplicationName              CreateTime              LinkedToGitHub
-------------                           ---------------              ----------              --------------
e07fb938-091e-4f2f-8963-4d3e8EXAMPLE    CodeDeployDemoApplication    7/20/2015 9:49:48 PM    False
```
+  Untuk detail API, lihat [GetApplication](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `GetApplicationRevision` dengan CLI
<a name="codedeploy_example_codedeploy_GetApplicationRevision_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`GetApplicationRevision`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang revisi aplikasi**  
`get-application-revision`Contoh berikut menampilkan informasi tentang revisi aplikasi yang terkait dengan aplikasi yang ditentukan.  

```
aws deploy get-application-revision \
    --application-name WordPress_App \
    --s3-location bucket=amzn-s3-demo-bucket,bundleType=zip,eTag=dd56cfdEXAMPLE8e768f9d77fEXAMPLE,key=WordPressApp.zip
```
Output:  

```
{
    "applicationName": "WordPress_App",
    "revisionInfo": {
        "description": "Application revision registered by Deployment ID: d-A1B2C3111",
        "registerTime": 1411076520.009,
        "deploymentGroups": "WordPress_DG",
        "lastUsedTime": 1411076520.009,
        "firstUsedTime": 1411076520.009
    },
    "revision": {
        "revisionType": "S3",
        "s3Location": {
            "bundleType": "zip",
            "eTag": "dd56cfdEXAMPLE8e768f9d77fEXAMPLE",
            "bucket": "amzn-s3-demo-bucket",
            "key": "WordPressApp.zip"
        }
    }
}
```
+  Untuk detail API, lihat [GetApplicationRevision](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-application-revision.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang revisi aplikasi yang ditentukan.**  

```
$revision = Get-CDApplicationRevision -ApplicationName CodeDeployDemoApplication -S3Location_Bucket amzn-s3-demo-bucket -Revision_RevisionType S3 -S3Location_Key 5xd27EX.zip -S3Location_BundleType zip -S3Location_ETag 4565c1ac97187f190c1a90265EXAMPLE
Write-Output ("Description = " + $revision.RevisionInfo.Description + ", RegisterTime = " + $revision.RevisionInfo.RegisterTime)
```
**Output:**  

```
Description = Application revision registered by Deployment ID: d-CX9CHN3EX, RegisterTime = 07/20/2015 23:46:42
```
+  Untuk detail API, lihat [GetApplicationRevision](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang revisi aplikasi yang ditentukan.**  

```
$revision = Get-CDApplicationRevision -ApplicationName CodeDeployDemoApplication -S3Location_Bucket amzn-s3-demo-bucket -Revision_RevisionType S3 -S3Location_Key 5xd27EX.zip -S3Location_BundleType zip -S3Location_ETag 4565c1ac97187f190c1a90265EXAMPLE
Write-Output ("Description = " + $revision.RevisionInfo.Description + ", RegisterTime = " + $revision.RevisionInfo.RegisterTime)
```
**Output:**  

```
Description = Application revision registered by Deployment ID: d-CX9CHN3EX, RegisterTime = 07/20/2015 23:46:42
```
+  Untuk detail API, lihat [GetApplicationRevision](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `GetDeployment` dengan CLI
<a name="codedeploy_example_codedeploy_GetDeployment_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`GetDeployment`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang penerapan**  
`get-deployment`Contoh berikut menampilkan informasi tentang penyebaran yang terkait dengan AWS akun pengguna.  

```
aws deploy get-deployment --deployment-id d-A1B2C3123
```
Output:  

```
{
    "deploymentInfo": {
        "applicationName": "WordPress_App",
        "status": "Succeeded",
        "deploymentOverview": {
            "Failed": 0,
            "InProgress": 0,
            "Skipped": 0,
            "Succeeded": 1,
            "Pending": 0
        },
        "deploymentConfigName": "CodeDeployDefault.OneAtATime",
        "creator": "user",
        "description": "My WordPress app deployment",
        "revision": {
            "revisionType": "S3",
            "s3Location":  {
            "bundleType": "zip",
            "eTag": "\"dd56cfdEXAMPLE8e768f9d77fEXAMPLE\"",
            "bucket": "amzn-s3-demo-bucket",
            "key": "WordPressApp.zip"
            }
        },
        "deploymentId": "d-A1B2C3123",
        "deploymentGroupName": "WordPress_DG",
        "createTime": 1409764576.589,
        "completeTime": 1409764596.101,
        "ignoreApplicationStopFailures": false
    }
}
```
+  Untuk detail API, lihat [GetDeployment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-deployment.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi ringkasan tentang penerapan yang ditentukan.**  

```
Get-CDDeployment -DeploymentId d-QZMRGSTEX
```
**Output:**  

```
ApplicationName               : CodeDeployDemoApplication
CompleteTime                  : 7/23/2015 11:26:04 PM
CreateTime                    : 7/23/2015 11:24:43 PM
Creator                       : user
DeploymentConfigName          : CodeDeployDefault.OneAtATime
DeploymentGroupName           : CodeDeployDemoFleet
DeploymentId                  : d-QZMRGSTEX
DeploymentOverview            : Amazon.CodeDeploy.Model.DeploymentOverview
Description                   :
ErrorInformation              :
IgnoreApplicationStopFailures : False
Revision                      : Amazon.CodeDeploy.Model.RevisionLocation
StartTime                     : 1/1/0001 12:00:00 AM
Status                        : Succeeded
```
**Contoh 2: Contoh ini mendapatkan informasi tentang status instance yang berpartisipasi dalam penerapan yang ditentukan.**  

```
(Get-CDDeployment -DeploymentId d-QZMRGSTEX).DeploymentOverview
```
**Output:**  

```
Failed     : 0
InProgress : 0
Pending    : 0
Skipped    : 0
Succeeded  : 3
```
**Contoh 3: Contoh ini mendapatkan informasi tentang revisi aplikasi untuk penerapan yang ditentukan.**  

```
(Get-CDDeployment -DeploymentId d-QZMRGSTEX).Revision.S3Location
```
**Output:**  

```
Bucket     : amzn-s3-demo-bucket
BundleType : zip
ETag       : cfbb81b304ee5e27efc21adaed3EXAMPLE
Key        : clzfqEX
Version    :
```
+  Untuk detail API, lihat [GetDeployment](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi ringkasan tentang penerapan yang ditentukan.**  

```
Get-CDDeployment -DeploymentId d-QZMRGSTEX
```
**Output:**  

```
ApplicationName               : CodeDeployDemoApplication
CompleteTime                  : 7/23/2015 11:26:04 PM
CreateTime                    : 7/23/2015 11:24:43 PM
Creator                       : user
DeploymentConfigName          : CodeDeployDefault.OneAtATime
DeploymentGroupName           : CodeDeployDemoFleet
DeploymentId                  : d-QZMRGSTEX
DeploymentOverview            : Amazon.CodeDeploy.Model.DeploymentOverview
Description                   :
ErrorInformation              :
IgnoreApplicationStopFailures : False
Revision                      : Amazon.CodeDeploy.Model.RevisionLocation
StartTime                     : 1/1/0001 12:00:00 AM
Status                        : Succeeded
```
**Contoh 2: Contoh ini mendapatkan informasi tentang status instance yang berpartisipasi dalam penerapan yang ditentukan.**  

```
(Get-CDDeployment -DeploymentId d-QZMRGSTEX).DeploymentOverview
```
**Output:**  

```
Failed     : 0
InProgress : 0
Pending    : 0
Skipped    : 0
Succeeded  : 3
```
**Contoh 3: Contoh ini mendapatkan informasi tentang revisi aplikasi untuk penerapan yang ditentukan.**  

```
(Get-CDDeployment -DeploymentId d-QZMRGSTEX).Revision.S3Location
```
**Output:**  

```
Bucket     : amzn-s3-demo-bucket
BundleType : zip
ETag       : cfbb81b304ee5e27efc21adaed3EXAMPLE
Key        : clzfqEX
Version    :
```
+  Untuk detail API, lihat [GetDeployment](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `GetDeploymentConfig` dengan CLI
<a name="codedeploy_example_codedeploy_GetDeploymentConfig_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`GetDeploymentConfig`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang konfigurasi penerapan**  
`get-deployment-config`Contoh berikut menampilkan informasi tentang konfigurasi penyebaran yang terkait dengan AWS akun pengguna.  

```
aws deploy get-deployment-config --deployment-config-name ThreeQuartersHealthy
```
Output:  

```
{
    "deploymentConfigInfo": {
        "deploymentConfigId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
        "minimumHealthyHosts": {
            "type": "FLEET_PERCENT",
            "value": 75
        },
        "createTime": 1411081164.379,
        "deploymentConfigName": "ThreeQuartersHealthy"
    }
}
```
+  Untuk detail API, lihat [GetDeploymentConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-deployment-config.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi ringkasan tentang konfigurasi penerapan yang ditentukan.**  

```
Get-CDDeploymentConfig -DeploymentConfigName ThreeQuartersHealthy
```
**Output:**  

```
CreateTime              DeploymentConfigId                      DeploymentConfigName    MinimumHealthyHosts
----------              ------------------                      --------------------    -------------------
10/3/2014 4:32:30 PM    518a3950-d034-46a1-9d2c-3c949EXAMPLE    ThreeQuartersHealthy    Amazon.CodeDeploy.Model.MinimumHealthyHosts
```
**Contoh 2: Contoh ini mendapatkan informasi tentang definisi konfigurasi penerapan yang ditentukan.**  

```
Write-Output ((Get-CDDeploymentConfig -DeploymentConfigName ThreeQuartersHealthy).MinimumHealthyHosts)
```
**Output:**  

```
Type             Value
----             -----
FLEET_PERCENT    75
```
+  Untuk detail API, lihat [GetDeploymentConfig](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi ringkasan tentang konfigurasi penerapan yang ditentukan.**  

```
Get-CDDeploymentConfig -DeploymentConfigName ThreeQuartersHealthy
```
**Output:**  

```
CreateTime              DeploymentConfigId                      DeploymentConfigName    MinimumHealthyHosts
----------              ------------------                      --------------------    -------------------
10/3/2014 4:32:30 PM    518a3950-d034-46a1-9d2c-3c949EXAMPLE    ThreeQuartersHealthy    Amazon.CodeDeploy.Model.MinimumHealthyHosts
```
**Contoh 2: Contoh ini mendapatkan informasi tentang definisi konfigurasi penerapan yang ditentukan.**  

```
Write-Output ((Get-CDDeploymentConfig -DeploymentConfigName ThreeQuartersHealthy).MinimumHealthyHosts)
```
**Output:**  

```
Type             Value
----             -----
FLEET_PERCENT    75
```
+  Untuk detail API, lihat [GetDeploymentConfig](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `GetDeploymentGroup` dengan CLI
<a name="codedeploy_example_codedeploy_GetDeploymentGroup_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`GetDeploymentGroup`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk melihat informasi tentang grup penyebaran**  
`get-deployment-group`Contoh berikut menampilkan informasi tentang grup penyebaran yang terkait dengan aplikasi yang ditentukan.  

```
aws deploy get-deployment-group \
    --application-name WordPress_App \
    --deployment-group-name WordPress_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"
    }
}
```
+  Untuk detail API, lihat [GetDeploymentGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-deployment-group.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang grup penyebaran yang ditentukan.**  

```
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
```
+  Untuk detail API, lihat [GetDeploymentGroup](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang grup penyebaran yang ditentukan.**  

```
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
```
+  Untuk detail API, lihat [GetDeploymentGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `GetDeploymentInstance` dengan CLI
<a name="codedeploy_example_codedeploy_GetDeploymentInstance_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`GetDeploymentInstance`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang instance penerapan**  
`get-deployment-instance`Contoh berikut menampilkan informasi tentang instance penyebaran yang terkait dengan penerapan yang ditentukan.  

```
aws deploy get-deployment-instance --deployment-id d-QA4G4F9EX --instance-id i-902e9fEX
```
Output:  

```
{
    "instanceSummary": {
        "instanceId": "arn:aws:ec2:us-east-1:80398EXAMPLE:instance/i-902e9fEX",
        "lifecycleEvents": [
            {
                "status": "Succeeded",
                "endTime": 1408480726.569,
                "startTime": 1408480726.437,
                "lifecycleEventName": "ApplicationStop"
            },
            {
                "status": "Succeeded",
                "endTime": 1408480728.016,
                "startTime": 1408480727.665,
                "lifecycleEventName": "DownloadBundle"
            },
            {
                "status": "Succeeded",
                "endTime": 1408480729.744,
                "startTime": 1408480729.125,
                "lifecycleEventName": "BeforeInstall"
            },
            {
                "status": "Succeeded",
                "endTime": 1408480730.979,
                "startTime": 1408480730.844,
                "lifecycleEventName": "Install"
            },
            {
                "status": "Failed",
                "endTime": 1408480732.603,
                "startTime": 1408480732.1,
                "lifecycleEventName": "AfterInstall"
            },
            {
                "status": "Skipped",
                "endTime": 1408480732.606,
                "lifecycleEventName": "ApplicationStart"
            },
            {
                "status": "Skipped",
                "endTime": 1408480732.606,
                "lifecycleEventName": "ValidateService"
            }
        ],
        "deploymentId": "d-QA4G4F9EX",
        "lastUpdatedAt": 1408480733.152,
        "status": "Failed"
    }
}
```
+  Untuk detail API, lihat [GetDeploymentInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-deployment-instance.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang instance yang ditentukan untuk penerapan yang ditentukan.**  

```
Get-CDDeploymentInstance -DeploymentId d-QZMRGSTEX -InstanceId i-254e22EX
```
**Output:**  

```
DeploymentId    : d-QZMRGSTEX
InstanceId      : arn:aws:ec2:us-east-1:80398EXAMPLE:instance/i-254e22EX
LastUpdatedAt   : 7/23/2015 11:25:24 PM
LifecycleEvents : {ApplicationStop, DownloadBundle, BeforeInstall, Install...}
Status          : Succeeded
```
+  Untuk detail API, lihat [GetDeploymentInstance](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang instance yang ditentukan untuk penerapan yang ditentukan.**  

```
Get-CDDeploymentInstance -DeploymentId d-QZMRGSTEX -InstanceId i-254e22EX
```
**Output:**  

```
DeploymentId    : d-QZMRGSTEX
InstanceId      : arn:aws:ec2:us-east-1:80398EXAMPLE:instance/i-254e22EX
LastUpdatedAt   : 7/23/2015 11:25:24 PM
LifecycleEvents : {ApplicationStop, DownloadBundle, BeforeInstall, Install...}
Status          : Succeeded
```
+  Untuk detail API, lihat [GetDeploymentInstance](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `GetOnPremisesInstance` dengan CLI
<a name="codedeploy_example_codedeploy_GetOnPremisesInstance_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`GetOnPremisesInstance`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang instans lokal**  
`get-on-premises-instance`Contoh berikut mengambil informasi tentang instans lokal yang ditentukan.  

```
aws deploy get-on-premises-instance --instance-name AssetTag12010298EX
```
Output:  

```
{
    "instanceInfo": {
    "iamUserArn": "arn:aws:iam::123456789012:user/AWS/CodeDeploy/AssetTag12010298EX",
        "tags": [
        {
            "Value": "CodeDeployDemo-OnPrem",
            "Key": "Name"
        }
        ],
        "instanceName": "AssetTag12010298EX",
        "registerTime": 1425579465.228,
        "instanceArn": "arn:aws:codedeploy:us-east-1:123456789012:instance/AssetTag12010298EX_4IwLNI2Alh"
    }
}
```
+  Untuk detail API, lihat [GetOnPremisesInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-on-premises-instance.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang instans lokal yang ditentukan.**  

```
Get-CDOnPremiseInstance -InstanceName AssetTag12010298EX
```
**Output:**  

```
DeregisterTime : 1/1/0001 12:00:00 AM
IamUserArn     : arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser
InstanceArn    : arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX_rDH556dxEX
InstanceName   : AssetTag12010298EX
RegisterTime   : 4/3/2015 6:36:24 PM
Tags           : {Name}
```
+  Untuk detail API, lihat [GetOnPremisesInstance](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang instans lokal yang ditentukan.**  

```
Get-CDOnPremiseInstance -InstanceName AssetTag12010298EX
```
**Output:**  

```
DeregisterTime : 1/1/0001 12:00:00 AM
IamUserArn     : arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser
InstanceArn    : arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX_rDH556dxEX
InstanceName   : AssetTag12010298EX
RegisterTime   : 4/3/2015 6:36:24 PM
Tags           : {Name}
```
+  Untuk detail API, lihat [GetOnPremisesInstance](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `ListApplicationRevisions` dengan CLI
<a name="codedeploy_example_codedeploy_ListApplicationRevisions_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`ListApplicationRevisions`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang revisi aplikasi**  
`list-application-revisions`Contoh berikut menampilkan informasi tentang semua revisi aplikasi yang terkait dengan aplikasi yang ditentukan.  

```
aws deploy list-application-revisions \
    --application-name WordPress_App \
    --s-3-bucket amzn-s3-demo-bucket \
    --deployed exclude \
    --s-3-key-prefix WordPress_ \
    --sort-by lastUsedTime \
    --sort-order descending
```
Output:  

```
{
    "revisions": [
        {
            "revisionType": "S3",
            "s3Location": {
                "version": "uTecLusvCB_JqHFXtfUcyfV8bEXAMPLE",
                "bucket": "amzn-s3-demo-bucket",
                "key": "WordPress_App.zip",
                "bundleType": "zip"
            }
        },
        {
            "revisionType": "S3",
            "s3Location": {
                "version": "tMk.UxgDpMEVb7V187ZM6wVAWEXAMPLE",
                "bucket": "amzn-s3-demo-bucket",
                "key": "WordPress_App_2-0.zip",
                "bundleType": "zip"
            }
        }
    ]
}
```
+  Untuk detail API, lihat [ListApplicationRevisions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/list-application-revisions.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan informasi tentang revisi yang tersedia untuk aplikasi yang ditentukan.**  

```
ForEach ($revision in (Get-CDApplicationRevisionList -ApplicationName CodeDeployDemoApplication -Deployed Ignore)) {
>>   If ($revision.RevisionType -Eq "S3") {
>>     Write-Output ("Type = S3, Bucket = " + $revision.S3Location.Bucket + ", BundleType = " + $revision.S3Location.BundleType + ", ETag = " + $revision.S3Location.ETag + ", Key = " + $revision.S3Location.Key)
>>   }
>>   If ($revision.RevisionType -Eq "GitHub") {
>>     Write-Output ("Type = GitHub, CommitId = " + $revision.GitHubLocation.CommitId + ", Repository = " + $revision.GitHubLocation.Repository)
>>   }
>> }
>>
```
**Output:**  

```
Type = S3, Bucket = amzn-s3-demo-bucket, BundleType = zip, ETag = 4565c1ac97187f190c1a90265EXAMPLE, Key = 5xd27EX.zip
Type = GitHub, CommitId = f48933c3...76405362, Repository = MyGitHubUser/CodeDeployDemoRepo
```
+  Untuk detail API, lihat [ListApplicationRevisions](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan informasi tentang revisi yang tersedia untuk aplikasi yang ditentukan.**  

```
ForEach ($revision in (Get-CDApplicationRevisionList -ApplicationName CodeDeployDemoApplication -Deployed Ignore)) {
>>   If ($revision.RevisionType -Eq "S3") {
>>     Write-Output ("Type = S3, Bucket = " + $revision.S3Location.Bucket + ", BundleType = " + $revision.S3Location.BundleType + ", ETag = " + $revision.S3Location.ETag + ", Key = " + $revision.S3Location.Key)
>>   }
>>   If ($revision.RevisionType -Eq "GitHub") {
>>     Write-Output ("Type = GitHub, CommitId = " + $revision.GitHubLocation.CommitId + ", Repository = " + $revision.GitHubLocation.Repository)
>>   }
>> }
>>
```
**Output:**  

```
Type = S3, Bucket = amzn-s3-demo-bucket, BundleType = zip, ETag = 4565c1ac97187f190c1a90265EXAMPLE, Key = 5xd27EX.zip
Type = GitHub, CommitId = f48933c3...76405362, Repository = MyGitHubUser/CodeDeployDemoRepo
```
+  Untuk detail API, lihat [ListApplicationRevisions](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `ListApplications` dengan CLI
<a name="codedeploy_example_codedeploy_ListApplications_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`ListApplications`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang aplikasi**  
`list-applications`Contoh berikut menampilkan informasi tentang semua aplikasi yang terkait dengan AWS akun pengguna.  

```
aws deploy list-applications
```
Output:  

```
{
    "applications": [
        "WordPress_App",
        "MyOther_App"
    ]
}
```
+  Untuk detail API, lihat [ListApplications](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/list-applications.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan daftar aplikasi yang tersedia.**  

```
Get-CDApplicationList
```
**Output:**  

```
CodeDeployDemoApplication
CodePipelineDemoApplication
```
+  Untuk detail API, lihat [ListApplications](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan daftar aplikasi yang tersedia.**  

```
Get-CDApplicationList
```
**Output:**  

```
CodeDeployDemoApplication
CodePipelineDemoApplication
```
+  Untuk detail API, lihat [ListApplications](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `ListDeploymentConfigs` dengan CLI
<a name="codedeploy_example_codedeploy_ListDeploymentConfigs_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`ListDeploymentConfigs`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang konfigurasi penerapan**  
`list-deployment-configs`Contoh berikut menampilkan informasi tentang semua konfigurasi penyebaran yang terkait dengan akun pengguna. AWS   

```
aws deploy list-deployment-configs
```
Output:  

```
{
    "deploymentConfigsList": [
        "ThreeQuartersHealthy",
        "CodeDeployDefault.AllAtOnce",
        "CodeDeployDefault.HalfAtATime",
        "CodeDeployDefault.OneAtATime"
    ]
}
```
+  Untuk detail API, lihat [ListDeploymentConfigs](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/list-deployment-configs.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan daftar konfigurasi penerapan yang tersedia.**  

```
Get-CDDeploymentConfigList
```
**Output:**  

```
ThreeQuartersHealthy
CodeDeployDefault.OneAtATime
CodeDeployDefault.AllAtOnce
CodeDeployDefault.HalfAtATime
```
+  Untuk detail API, lihat [ListDeploymentConfigs](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan daftar konfigurasi penerapan yang tersedia.**  

```
Get-CDDeploymentConfigList
```
**Output:**  

```
ThreeQuartersHealthy
CodeDeployDefault.OneAtATime
CodeDeployDefault.AllAtOnce
CodeDeployDefault.HalfAtATime
```
+  Untuk detail API, lihat [ListDeploymentConfigs](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `ListDeploymentGroups` dengan CLI
<a name="codedeploy_example_codedeploy_ListDeploymentGroups_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`ListDeploymentGroups`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang grup penyebaran**  
`list-deployment-groups`Contoh berikut menampilkan informasi tentang semua kelompok penyebaran yang terkait dengan aplikasi yang ditentukan.  

```
aws deploy list-deployment-groups --application-name WordPress_App
```
Output:  

```
{
    "applicationName": "WordPress_App",
    "deploymentGroups": [
        "WordPress_DG",
        "WordPress_Beta_DG"
    ]
}
```
+  Untuk detail API, lihat [ListDeploymentGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/list-deployment-groups.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan daftar grup penyebaran untuk aplikasi yang ditentukan.**  

```
Get-CDDeploymentGroupList -ApplicationName CodeDeployDemoApplication
```
**Output:**  

```
ApplicationName              DeploymentGroups                                    NextToken
---------------              ----------------                                    ---------
CodeDeployDemoApplication    {CodeDeployDemoFleet, CodeDeployProductionFleet}
```
+  Untuk detail API, lihat [ListDeploymentGroups](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan daftar grup penyebaran untuk aplikasi yang ditentukan.**  

```
Get-CDDeploymentGroupList -ApplicationName CodeDeployDemoApplication
```
**Output:**  

```
ApplicationName              DeploymentGroups                                    NextToken
---------------              ----------------                                    ---------
CodeDeployDemoApplication    {CodeDeployDemoFleet, CodeDeployProductionFleet}
```
+  Untuk detail API, lihat [ListDeploymentGroups](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `ListDeploymentInstances` dengan CLI
<a name="codedeploy_example_codedeploy_ListDeploymentInstances_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`ListDeploymentInstances`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang instance penerapan**  
`list-deployment-instances`Contoh berikut menampilkan informasi tentang semua instance penerapan yang terkait dengan penerapan yang ditentukan.  

```
aws deploy list-deployment-instances \
    --deployment-id d-A1B2C3111 \
    --instance-status-filter Succeeded
```
Output:  

```
{
    "instancesList": [
        "i-EXAMPLE11",
        "i-EXAMPLE22"
    ]
}
```
+  Untuk detail API, lihat [ListDeploymentInstances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/list-deployment-instances.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan daftar instance IDs untuk penerapan yang ditentukan.**  

```
Get-CDDeploymentInstanceList -DeploymentId d-QZMRGSTEX
```
**Output:**  

```
i-254e22EX
i-274e22EX
i-3b4e22EX
```
+  Untuk detail API, lihat [ListDeploymentInstances](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan daftar instance IDs untuk penerapan yang ditentukan.**  

```
Get-CDDeploymentInstanceList -DeploymentId d-QZMRGSTEX
```
**Output:**  

```
i-254e22EX
i-274e22EX
i-3b4e22EX
```
+  Untuk detail API, lihat [ListDeploymentInstances](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `ListDeployments` dengan CLI
<a name="codedeploy_example_codedeploy_ListDeployments_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`ListDeployments`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang penerapan**  
`list-deployments`Contoh berikut menampilkan informasi tentang semua penerapan yang terkait dengan kelompok aplikasi dan penyebaran yang ditentukan.  

```
aws deploy list-deployments \
    --application-name WordPress_App \
    --create-time-range start=2014-08-19T00:00:00,end=2014-08-20T00:00:00 \
    --deployment-group-name WordPress_DG \
    --include-only-statuses Failed
```
Output:  

```
{
    "deployments": [
        "d-EXAMPLE11",
        "d-EXAMPLE22",
        "d-EXAMPLE33"
    ]
}
```
+  Untuk detail API, lihat [ListDeployments](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/list-deployments.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan daftar penerapan IDs untuk grup aplikasi dan penyebaran yang ditentukan.**  

```
Get-CDDeploymentList -ApplicationName CodeDeployDemoApplication -DeploymentGroupName CodeDeployDemoFleet
```
**Output:**  

```
d-QZMRGSTEX
d-RR0T5KTEX
```
+  Untuk detail API, lihat [ListDeployments](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan daftar penerapan IDs untuk grup aplikasi dan penyebaran yang ditentukan.**  

```
Get-CDDeploymentList -ApplicationName CodeDeployDemoApplication -DeploymentGroupName CodeDeployDemoFleet
```
**Output:**  

```
d-QZMRGSTEX
d-RR0T5KTEX
```
+  Untuk detail API, lihat [ListDeployments](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `ListOnPremisesInstances` dengan CLI
<a name="codedeploy_example_codedeploy_ListOnPremisesInstances_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`ListOnPremisesInstances`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendapatkan informasi tentang satu atau beberapa instans lokal**  
`list-on-premises-instances`Contoh berikut mengambil daftar nama instans lokal yang tersedia untuk instance yang terdaftar AWS CodeDeploy dan juga memiliki tag instans lokal tertentu yang terkait dengan instans. AWS CodeDeploy   

```
aws deploy list-on-premises-instances \
    --registration-status Registered \
    --tag-filters Key=Name,Value=CodeDeployDemo-OnPrem,Type=KEY_AND_VALUE
```
Output:  

```
{
    "instanceNames": [
        "AssetTag12010298EX"
    ]
}
```
+  Untuk detail API, lihat [ListOnPremisesInstances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/list-on-premises-instances.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendapatkan daftar nama instans lokal yang tersedia.**  

```
Get-CDOnPremiseInstanceList
```
**Output:**  

```
AssetTag12010298EX
AssetTag12010298EX-2
```
+  Untuk detail API, lihat [ListOnPremisesInstances](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendapatkan daftar nama instans lokal yang tersedia.**  

```
Get-CDOnPremiseInstanceList
```
**Output:**  

```
AssetTag12010298EX
AssetTag12010298EX-2
```
+  Untuk detail API, lihat [ListOnPremisesInstances](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `RegisterApplicationRevision` dengan CLI
<a name="codedeploy_example_codedeploy_RegisterApplicationRevision_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`RegisterApplicationRevision`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendaftarkan informasi tentang revisi aplikasi yang sudah diunggah**  
`register-application-revision`Contoh berikut mendaftarkan informasi tentang revisi aplikasi yang sudah diunggah yang disimpan di Amazon S3 dengan. AWS CodeDeploy  

```
aws deploy register-application-revision \
    --application-name WordPress_App \
    --description "Revised WordPress application" \
    --s3-location bucket=amzn-s3-demo-bucket,key=RevisedWordPressApp.zip,bundleType=zip,eTag=cecc9b8a08eac650a6e71fdb88EXAMPLE
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [RegisterApplicationRevision](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/register-application-revision.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendaftarkan revisi aplikasi dengan lokasi Amazon S3 yang ditentukan, untuk aplikasi yang ditentukan.**  

```
Register-CDApplicationRevision -ApplicationName MyNewApplication -S3Location_Bucket amzn-s3-demo-bucket -S3Location_BundleType zip -S3Location_Key aws-codedeploy_linux-master.zip -Revision_RevisionType S3
```
+  Untuk detail API, lihat [RegisterApplicationRevision](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendaftarkan revisi aplikasi dengan lokasi Amazon S3 yang ditentukan, untuk aplikasi yang ditentukan.**  

```
Register-CDApplicationRevision -ApplicationName MyNewApplication -S3Location_Bucket amzn-s3-demo-bucket -S3Location_BundleType zip -S3Location_Key aws-codedeploy_linux-master.zip -Revision_RevisionType S3
```
+  Untuk detail API, lihat [RegisterApplicationRevision](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `RegisterOnPremisesInstance` dengan CLI
<a name="codedeploy_example_codedeploy_RegisterOnPremisesInstance_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`RegisterOnPremisesInstance`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mendaftarkan instans lokal**  
`register-on-premises-instance`Contoh berikut mendaftarkan instance lokal dengan. AWS CodeDeploy Itu tidak membuat pengguna IAM yang ditentukan, juga tidak mengaitkan tag instance lokal dengan instance terdaftar. AWS CodeDeploy   

```
aws deploy register-on-premises-instance \
    --instance-name AssetTag12010298EX \
    --iam-user-arn arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser-OnPrem
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [RegisterOnPremisesInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/register-on-premises-instance.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mendaftarkan instance lokal dengan nama yang ditentukan dan pengguna IAM.**  

```
Register-CDOnPremiseInstance -IamUserArn arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser -InstanceName AssetTag12010298EX
```
+  Untuk detail API, lihat [RegisterOnPremisesInstance](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mendaftarkan instance lokal dengan nama yang ditentukan dan pengguna IAM.**  

```
Register-CDOnPremiseInstance -IamUserArn arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser -InstanceName AssetTag12010298EX
```
+  Untuk detail API, lihat [RegisterOnPremisesInstance](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `RemoveTagsFromOnPremisesInstances` dengan CLI
<a name="codedeploy_example_codedeploy_RemoveTagsFromOnPremisesInstances_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`RemoveTagsFromOnPremisesInstances`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk menghapus tag dari satu atau beberapa instance lokal**  
`remove-tags-from-on-premises-instances`Contoh berikut memisahkan tag lokal yang ditentukan AWS CodeDeploy dari instance lokal. Itu tidak membatalkan pendaftaran instans lokal di AWS CodeDeploy, atau menghapus Instans dari instans, AWS CodeDeploy atau menghapus file konfigurasi lokal dari instance, atau menghapus pengguna IAM yang terkait dengan instans.  

```
aws deploy remove-tags-from-on-premises-instances \
    --instance-names AssetTag12010298EX AssetTag23121309EX \
    --tags Key=Name,Value=CodeDeployDemo-OnPrem
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [RemoveTagsFromOnPremisesInstances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/remove-tags-from-on-premises-instances.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini menghapus tag yang ditentukan untuk instance lokal dengan nama yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus tag tanpa prompt.**  

```
Remove-CDOnPremiseInstanceTag -InstanceName AssetTag12010298EX -Tag @{"Key" = "Name"; "Value" = "CodeDeployDemo-OnPrem"}
```
+  Untuk detail API, lihat [RemoveTagsFromOnPremisesInstances](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini menghapus tag yang ditentukan untuk instance lokal dengan nama yang ditentukan. Perintah akan meminta konfirmasi sebelum melanjutkan. Tambahkan parameter -Force untuk menghapus tag tanpa prompt.**  

```
Remove-CDOnPremiseInstanceTag -InstanceName AssetTag12010298EX -Tag @{"Key" = "Name"; "Value" = "CodeDeployDemo-OnPrem"}
```
+  Untuk detail API, lihat [RemoveTagsFromOnPremisesInstances](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `StopDeployment` dengan CLI
<a name="codedeploy_example_codedeploy_StopDeployment_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`StopDeployment`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mencoba menghentikan penerapan**  
`stop-deployment`Contoh berikut mencoba menghentikan penerapan yang sedang berlangsung yang terkait dengan akun pengguna. AWS   
aws menyebarkan stop-deployment --deployment-id d-A1b2c3111  
Output:  

```
{
    "status": "Succeeded",
    "statusMessage": "No more commands will be scheduled for execution in the deployment instances"
}
```
+  Untuk detail API, lihat [StopDeployment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/stop-deployment.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mencoba menghentikan penerapan dengan ID penerapan yang ditentukan.**  

```
Stop-CDDeployment -DeploymentId d-LJQNREYEX
```
**Output:**  

```
Status     StatusMessage
------     -------------
Pending    Stopping Pending. Stopping to schedule commands in the deployment instances
```
+  Untuk detail API, lihat [StopDeployment](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mencoba menghentikan penerapan dengan ID penerapan yang ditentukan.**  

```
Stop-CDDeployment -DeploymentId d-LJQNREYEX
```
**Output:**  

```
Status     StatusMessage
------     -------------
Pending    Stopping Pending. Stopping to schedule commands in the deployment instances
```
+  Untuk detail API, lihat [StopDeployment](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `UpdateApplication` dengan CLI
<a name="codedeploy_example_codedeploy_UpdateApplication_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`UpdateApplication`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mengubah detail aplikasi**  
`update-application`Contoh berikut mengubah nama aplikasi yang dikaitkan dengan AWS akun pengguna.  

```
aws deploy update-application \
    --application-name WordPress_App \
    --new-application-name My_WordPress_App
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [UpdateApplication](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/update-application.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mengubah nama aplikasi yang ditentukan.**  

```
Update-CDApplication -ApplicationName MyNewApplication -NewApplicationName MyNewApplication-2
```
+  Untuk detail API, lihat [UpdateApplication](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengubah nama aplikasi yang ditentukan.**  

```
Update-CDApplication -ApplicationName MyNewApplication -NewApplicationName MyNewApplication-2
```
+  Untuk detail API, lihat [UpdateApplication](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------

# Gunakan `UpdateDeploymentGroup` dengan CLI
<a name="codedeploy_example_codedeploy_UpdateDeploymentGroup_section"></a>

Contoh kode berikut menunjukkan cara menggunakan`UpdateDeploymentGroup`.

------
#### [ CLI ]

**AWS CLI**  
**Untuk mengubah informasi tentang grup penyebaran**  
`update-deployment-group`Contoh berikut mengubah pengaturan grup penyebaran yang terkait dengan aplikasi yang ditentukan.  

```
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
```
Perintah ini tidak menghasilkan output.  
+  Untuk detail API, lihat [UpdateDeploymentGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/update-deployment-group.html)di *Referensi AWS CLI Perintah*. 

------
#### [ PowerShell ]

**Alat untuk PowerShell V4**  
**Contoh 1: Contoh ini mengubah nama grup penyebaran yang ditentukan untuk aplikasi yang ditentukan.**  

```
Update-CDDeploymentGroup -ApplicationName MyNewApplication -CurrentDeploymentGroupName MyNewDeploymentGroup -NewDeploymentGroupName MyNewDeploymentGroup-2
```
**Contoh 2: Contoh ini menunjukkan cara menentukan grup tag instans EC2 yang harus diidentifikasi oleh sebuah instance agar dapat disertakan dalam lingkungan pengganti untuk blue/green penerapan.**  

```
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"})
```
+  Untuk detail API, lihat [UpdateDeploymentGroup](https://docs.aws.amazon.com/powershell/v4/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V4)*. 

**Alat untuk PowerShell V5**  
**Contoh 1: Contoh ini mengubah nama grup penyebaran yang ditentukan untuk aplikasi yang ditentukan.**  

```
Update-CDDeploymentGroup -ApplicationName MyNewApplication -CurrentDeploymentGroupName MyNewDeploymentGroup -NewDeploymentGroupName MyNewDeploymentGroup-2
```
**Contoh 2: Contoh ini menunjukkan cara menentukan grup tag instans EC2 yang harus diidentifikasi oleh sebuah instance agar dapat disertakan dalam lingkungan pengganti untuk blue/green penerapan.**  

```
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"})
```
+  Untuk detail API, lihat [UpdateDeploymentGroup](https://docs.aws.amazon.com/powershell/v5/reference)di *Referensi Alat AWS untuk PowerShell Cmdlet (V5)*. 

------