Use DescribeNetworkInterfaceAttribute com um AWS SDK ou CLI - AWS SDKExemplos de código

Há mais AWS SDK exemplos disponíveis no GitHub repositório AWS Doc SDK Examples.

As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.

Use DescribeNetworkInterfaceAttribute com um AWS SDK ou CLI

Os exemplos de código a seguir mostram como usar o DescribeNetworkInterfaceAttribute.

CLI
AWS CLI

Para descrever o atributo de anexo de uma interface de rede

Este exemplo de comando descreve o attachment atributo da interface de rede especificada.

Comando:

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

Saída:

{ "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" } }

Para descrever o atributo de descrição de uma interface de rede

Este exemplo de comando descreve o description atributo da interface de rede especificada.

Comando:

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

Saída:

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

Para descrever o groupSet atributo de uma interface de rede

Este exemplo de comando descreve o groupSet atributo da interface de rede especificada.

Comando:

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

Saída:

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

Para descrever o sourceDestCheck atributo de uma interface de rede

Este exemplo de comando descreve o sourceDestCheck atributo da interface de rede especificada.

Comando:

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

Saída:

{ "NetworkInterfaceId": "eni-686ea200", "SourceDestCheck": { "Value": true } }
PowerShell
Ferramentas para PowerShell

Exemplo 1: Este exemplo descreve a interface de rede especificada.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute Attachment

Saída:

Attachment : Amazon.EC2.Model.NetworkInterfaceAttachment

Exemplo 2: Este exemplo descreve a interface de rede especificada.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute Description

Saída:

Description : My description

Exemplo 3: Este exemplo descreve a interface de rede especificada.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute GroupSet

Saída:

Groups : {my-security-group}

Exemplo 4: Este exemplo descreve a interface de rede especificada.

Get-EC2NetworkInterfaceAttribute -NetworkInterfaceId eni-12345678 -Attribute SourceDestCheck

Saída:

SourceDestCheck : True