CLI로 DescribeInstanceAttribute 사용 - Amazon Elastic Compute Cloud

CLI로 DescribeInstanceAttribute 사용

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

CLI
AWS CLI

인스턴스 유형 설명

이 예시에서는 지정된 인스턴스의 인스턴스 유형을 설명합니다.

명령:

aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute instanceType

결과:

{ "InstanceId": "i-1234567890abcdef0" "InstanceType": { "Value": "t1.micro" } }

disableApiTermination 속성 설명

이 예시에서는 지정된 인스턴스의 disableApiTermination 속성을 설명합니다.

명령:

aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute disableApiTermination

결과:

{ "InstanceId": "i-1234567890abcdef0" "DisableApiTermination": { "Value": "false" } }

인스턴스의 블록 디바이스 매핑 설명

이 예시에서는 지정된 인스턴스의 blockDeviceMapping 속성을 설명합니다.

명령:

aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute blockDeviceMapping

결과:

{ "InstanceId": "i-1234567890abcdef0" "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "Status": "attached", "DeleteOnTermination": true, "VolumeId": "vol-049df61146c4d7901", "AttachTime": "2013-05-17T22:42:34.000Z" } }, { "DeviceName": "/dev/sdf", "Ebs": { "Status": "attached", "DeleteOnTermination": false, "VolumeId": "vol-049df61146c4d7901", "AttachTime": "2013-09-10T23:07:00.000Z" } } ], }
PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 지정된 인스턴스의 인스턴스 유형을 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceType

출력:

InstanceType : t2.micro

예제 2: 이 예제에서는 지정된 인스턴스에 대해 향상된 네트워킹이 활성화되었는지 여부를 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sriovNetSupport

출력:

SriovNetSupport : simple

예제 3: 이 예제에서는 지정된 인스턴스의 보안 그룹을 설명합니다.

(Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute groupSet).Groups

출력:

GroupId ------- sg-12345678 sg-45678901

예제 4: 이 예제에서는 지정된 인스턴스에 대해 EBS 최적화가 활성화되었는지 여부를 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute ebsOptimized

출력:

EbsOptimized : False

예제 5: 이 예제에서는 지정된 인스턴스의 'disableApiTermination' 속성을 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute disableApiTermination

출력:

DisableApiTermination : False

예제 6: 이 예제에서는 지정된 인스턴스의 'instanceInitiatedShutdownBehavior' 속성을 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceInitiatedShutdownBehavior

출력:

InstanceInitiatedShutdownBehavior : stop
Tools for PowerShell V5

예제 1: 이 예제에서는 지정된 인스턴스의 인스턴스 유형을 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceType

출력:

InstanceType : t2.micro

예제 2: 이 예제에서는 지정된 인스턴스에 대해 향상된 네트워킹이 활성화되었는지 여부를 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sriovNetSupport

출력:

SriovNetSupport : simple

예제 3: 이 예제에서는 지정된 인스턴스의 보안 그룹을 설명합니다.

(Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute groupSet).Groups

출력:

GroupId ------- sg-12345678 sg-45678901

예제 4: 이 예제에서는 지정된 인스턴스에 대해 EBS 최적화가 활성화되었는지 여부를 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute ebsOptimized

출력:

EbsOptimized : False

예제 5: 이 예제에서는 지정된 인스턴스의 'disableApiTermination' 속성을 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute disableApiTermination

출력:

DisableApiTermination : False

예제 6: 이 예제에서는 지정된 인스턴스의 'instanceInitiatedShutdownBehavior' 속성을 설명합니다.

Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceInitiatedShutdownBehavior

출력:

InstanceInitiatedShutdownBehavior : stop

AWS SDK 개발자 가이드 및 코드 예시의 전체 목록은 AWS SDK를 사용하여 Amazon EC2 리소스 생성 섹션을 참조하세요. 이 주제에는 시작하기에 대한 정보와 이전 SDK 버전에 대한 세부 정보도 포함되어 있습니다.