GetInstanceProfileOR와 함께 사용 AWS SDK CLI - AWS SDK코드 예제

AWS 문서 AWS SDK SDK 예제 GitHub 리포지토리에 더 많은 예제가 있습니다.

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

GetInstanceProfileOR와 함께 사용 AWS SDK CLI

다음 코드 예제는 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설명서의 인스턴스 프로필 사용을 참조하십시오.

PowerShell
에 대한 도구 PowerShell

예 1: 이 예제는 현재 AWS 계정에 정의된 이름이 지정된 ec2instancerole 인스턴스 프로필의 세부 정보를 반환합니다.

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 참조를 참조하십시오 GetInstanceProfile.