Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
CLI로 GetInstanceProfile 사용
다음 코드 예시는 GetInstanceProfile의 사용 방법을 보여 줍니다.
작업 예제는 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 다음 코드 예제에서는 컨텍스트 내에서 이 작업을 확인할 수 있습니다.
- CLI
-
- AWS CLI
-
인스턴스 프로파일 정보 가져오기
다음
get-instance-profile명령은 이름이ExampleInstanceProfile인 인스턴스 프로파일에 대한 정보를 가져옵니다.aws iam get-instance-profile \ --instance-profile-nameExampleInstanceProfile출력:
{ "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 사용 설명서의 인스턴스 프로파일 사용을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetInstanceProfile
을 참조하세요.
-
- 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을 참조하세요.
-
- 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을 참조하세요.
-
GetGroupPolicy
GetLoginProfile