CLI로 DescribeNetworkInterfaceAttribute 사용 - Amazon Elastic Compute Cloud

CLI로 DescribeNetworkInterfaceAttribute 사용

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

CLI
AWS CLI

네트워크 인터페이스의 연결 속성 설명

이 예시 명령은 지정된 네트워크 인터페이스의 attachment 속성을 설명합니다.

명령:

aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute attachment

결과:

{ "NetworkInterfaceId": "eni-686ea200", "Attachment": { "Status": "attached", "DeviceIndex": 0, "AttachTime": "2015-05-21T20:02:20.000Z", "InstanceId": "i-1234567890abcdef0", "DeleteOnTermination": true, "AttachmentId": "eni-attach-43348162", "InstanceOwnerId": "123456789012" } }

네트워크 인터페이스의 설명 속성 설명

이 예시 명령은 지정된 네트워크 인터페이스의 description 속성을 설명합니다.

명령:

aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute description

결과:

{ "NetworkInterfaceId": "eni-686ea200", "Description": { "Value": "My description" } }

네트워크 인터페이스의 groupSet 속성 설명

이 예시 명령은 지정된 네트워크 인터페이스의 groupSet 속성을 설명합니다.

명령:

aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute groupSet

결과:

{ "NetworkInterfaceId": "eni-686ea200", "Groups": [ { "GroupName": "my-security-group", "GroupId": "sg-903004f8" } ] }

네트워크 인터페이스의 sourceDestCheck 속성 설명

이 예시 명령은 지정된 네트워크 인터페이스의 sourceDestCheck 속성을 설명합니다.

명령:

aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute sourceDestCheck

결과:

{ "NetworkInterfaceId": "eni-686ea200", "SourceDestCheck": { "Value": true } }
PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute Attachment

출력:

Attachment : Amazon.EC2.Model.NetworkInterfaceAttachment

예제 2: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute Description

출력:

Description : My description

예제 3: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute GroupSet

출력:

Groups : {my-security-group}

예제 4: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute SourceDestCheck

출력:

SourceDestCheck : True
Tools for PowerShell V5

예제 1: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute Attachment

출력:

Attachment : Amazon.EC2.Model.NetworkInterfaceAttachment

예제 2: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute Description

출력:

Description : My description

예제 3: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute GroupSet

출력:

Groups : {my-security-group}

예제 4: 이 예제에서는 지정된 네트워크 인터페이스를 설명합니다.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute SourceDestCheck

출력:

SourceDestCheck : True

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