Select your cookie preferences

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

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

Use GetOnPremisesInstance with a CLI - AWS SDK Code Examples

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

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

Use GetOnPremisesInstance with a CLI

The following code examples show how to use GetOnPremisesInstance.

CLI
AWS CLI

To get information about an on-premises instance

The following get-on-premises-instance example retrieves information about the specified on-premises instance.

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" } }
PowerShell
Tools for PowerShell

Example 1: This example gets information about the specified on-premises instance.

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}
AWS CLI

To get information about an on-premises instance

The following get-on-premises-instance example retrieves information about the specified on-premises instance.

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" } }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.