

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. [AWS](https://github.com/awsdocs/aws-doc-sdk-examples) 

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# CLI로 `GetOnPremisesInstance` 사용
<a name="codedeploy_example_codedeploy_GetOnPremisesInstance_section"></a>

다음 코드 예시는 `GetOnPremisesInstance`의 사용 방법을 보여 줍니다.

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

**AWS CLI**  
**단일 온프레미스 인스턴스에 대한 정보 가져오기**  
다음 `get-on-premises-instance` 예시에서는 지정된 온프레미스 인스턴스에 대한 정보를 검색합니다.  

```
aws deploy get-on-premises-instance --instance-name AssetTag12010298EX
```
출력:  

```
{
    "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"
    }
}
```
+  API 세부 정보는 *AWS CLI 명령 참조*의 [GetOnPremisesInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/get-on-premises-instance.html) 섹션을 참조하세요.

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

**Tools for PowerShell V4**  
**예제 1: 이 예제에서는 지정된 온프레미스 인스턴스에 대한 정보를 가져옵니다.**  

```
Get-CDOnPremiseInstance -InstanceName AssetTag12010298EX
```
**출력:**  

```
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}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [GetOnPremisesInstance](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 온프레미스 인스턴스에 대한 정보를 가져옵니다.**  

```
Get-CDOnPremiseInstance -InstanceName AssetTag12010298EX
```
**출력:**  

```
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}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetOnPremisesInstance](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------