

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

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

# CLI로 `GetInstanceProfile` 사용
<a name="iam_example_iam_GetInstanceProfile_section"></a>

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

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

**AWS CLI**  
**인스턴스 프로파일 정보 가져오기**  
다음 `get-instance-profile` 명령은 이름이 `ExampleInstanceProfile`인 인스턴스 프로파일에 대한 정보를 가져옵니다.  

```
aws iam get-instance-profile \
    --instance-profile-name ExampleInstanceProfile
```
출력:  

```
{
    "InstanceProfile": {
        "InstanceProfileId": "AID2MAB8DPLSRHEXAMPLE",
        "Roles": [
            {
                "AssumeRolePolicyDocument": "<URL-encoded-JSON>",
                "RoleId": "AIDGPMS9RO4H3FEXAMPLE",
                "CreateDate": "2013-01-09T06:33:26Z",
                "RoleName": "Test-Role",
                "Path": "/",
                "Arn": "arn:aws:iam::336924118301:role/Test-Role"
            }
        ],
        "CreateDate": "2013-06-12T23:52:02Z",
        "InstanceProfileName": "ExampleInstanceProfile",
        "Path": "/",
        "Arn": "arn:aws:iam::336924118301:instance-profile/ExampleInstanceProfile"
    }
}
```
자세한 내용은 **AWS IAM 사용 설명서의 [인스턴스 프로파일 사용](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html)을 참조하세요.  
+  API 세부 정보는 **AWS CLI 명령 참조의 [GetInstanceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/get-instance-profile.html)을 참조하세요.

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

**Tools for PowerShell V4**  
**예제 1:이 예제`ec2instancerole`는 현재 AWS 계정에 정의된 인스턴스 프로파일의 세부 정보를 반환합니다.**  

```
Get-IAMInstanceProfile -InstanceProfileName ec2instancerole
```
**출력:**  

```
Arn                 : arn:aws:iam::123456789012:instance-profile/ec2instancerole
CreateDate          : 2/17/2015 2:49:04 PM
InstanceProfileId   : HH36PTZQJUR32EXAMPLE1
InstanceProfileName : ec2instancerole
Path                : /
Roles               : {ec2instancerole}
```
+  API 세부 정보는 **AWS Tools for PowerShell Cmdlet 참조(V4)의 [GetInstanceProfile](https://docs.aws.amazon.com/powershell/v4/reference)을 참조하세요.

**Tools for PowerShell V5**  
**예제 1:이 예제`ec2instancerole`는 현재 AWS 계정에 정의된 인스턴스 프로파일의 세부 정보를 반환합니다.**  

```
Get-IAMInstanceProfile -InstanceProfileName ec2instancerole
```
**출력:**  

```
Arn                 : arn:aws:iam::123456789012:instance-profile/ec2instancerole
CreateDate          : 2/17/2015 2:49:04 PM
InstanceProfileId   : HH36PTZQJUR32EXAMPLE1
InstanceProfileName : ec2instancerole
Path                : /
Roles               : {ec2instancerole}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

------