AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제
CLI로 DescribeIdentityIdFormat 사용
다음 코드 예시는 DescribeIdentityIdFormat의 사용 방법을 보여 줍니다.
- CLI
-
- AWS CLI
-
IAM 역할의 ID 형식 설명
다음
describe-identity-id-format예시에서는 AWS 계정의EC2RoleIAM 역할에 의해 만들어진 인스턴스가 수신하는 ID 형식을 설명합니다.aws ec2 describe-identity-id-format \ --principal-arnarn:aws:iam::123456789012:role/my-iam-role\ --resourceinstance다음 출력에서는 이 역할에 의해 생성된 인스턴스가 긴 ID 형식의 ID를 수신한다는 것을 나타냅니다.
{ "Statuses": [ { "Deadline": "2016-12-15T00:00:00Z", "Resource": "instance", "UseLongIds": true } ] }IAM 사용자의 ID 형식 설명
다음
describe-identity-id-format예시에서는 AWS 계정의AdminUserIAM 사용자에 의해 만들어진 스냅샷 수신하는 ID 형식을 설명합니다.aws ec2 describe-identity-id-format \ --principal-arnarn:aws:iam::123456789012:user/AdminUser\ --resourcesnapshot출력은 이 사용자가 만든 스냅샷이 긴 ID 형식의 ID를 받는다는 것을 나타냅니다.
{ "Statuses": [ { "Deadline": "2016-12-15T00:00:00Z", "Resource": "snapshot", "UseLongIds": true } ] }-
API 세부 정보는 AWS CLI 명령 참조의 DescribeIdentityIdFormat
섹션을 참조하세요.
-
- PowerShell
-
- Tools for PowerShell V4
-
예제 1: 이 예제에서는 지정된 역할에 대한 리소스 'image'의 ID 형식을 반환합니다.
Get-EC2IdentityIdFormat -PrincipalArn arn:aws:iam::123456789511:role/JDBC -Resource image출력:
Deadline Resource UseLongIds -------- -------- ---------- 8/2/2018 11:30:00 PM image True-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)의 DescribeIdentityIdFormat을 참조하세요.
-
- Tools for PowerShell V5
-
예제 1: 이 예제에서는 지정된 역할에 대한 리소스 'image'의 ID 형식을 반환합니다.
Get-EC2IdentityIdFormat -PrincipalArn arn:aws:iam::123456789511:role/JDBC -Resource image출력:
Deadline Resource UseLongIds -------- -------- ---------- 8/2/2018 11:30:00 PM image True-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)의 DescribeIdentityIdFormat을 참조하세요.
-