View a markdown version of this page

Utilizzare DescribeVpcAttribute con una CLI - Amazon Elastic Compute Cloud

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Utilizzare DescribeVpcAttribute con una CLI

I seguenti esempi di codice mostrano come usareDescribeVpcAttribute.

CLI
AWS CLI

Per descrivere l'attributo enable DnsSupport

Questo esempio descrive l’attributo enableDnsSupport. Questo attributo indica se la risoluzione DNS è abilitata per il VPC. Se questo attributo è true, il server Amazon DNS risolve i nomi host DNS per le istanze negli indirizzi IP corrispondenti, ma solo in quel caso.

Comando:

aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsSupport

Output:

{ "VpcId": "vpc-a01106c2", "EnableDnsSupport": { "Value": true } }

Per descrivere l'DnsHostnames attributo enable

Questo esempio descrive l’attributo enableDnsHostnames. Questo attributo indica se le istanze avviate nel VPC ricevono nomi di host DNS. Se questo attributo è true, le istanze nel VPC ottengono nomi host DNS, altrimenti no.

Comando:

aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsHostnames

Output:

{ "VpcId": "vpc-a01106c2", "EnableDnsHostnames": { "Value": true } }
PowerShell
Strumenti per PowerShell V4

Esempio 1: questo esempio descrive l'attributo DnsSupport 'abilita'.

Get-EC2VpcAttribute -VpcId vpc-12345678 -Attribute enableDnsSupport

Output:

EnableDnsSupport ---------------- True

Esempio 2: questo esempio descrive l'attributo DnsHostnames 'abilita'.

Get-EC2VpcAttribute -VpcId vpc-12345678 -Attribute enableDnsHostnames

Output:

EnableDnsHostnames ------------------ True
Strumenti per V5 PowerShell

Esempio 1: questo esempio descrive l'attributo DnsSupport 'abilita'.

Get-EC2VpcAttribute -VpcId vpc-12345678 -Attribute enableDnsSupport

Output:

EnableDnsSupport ---------------- True

Esempio 2: questo esempio descrive l'attributo DnsHostnames 'abilita'.

Get-EC2VpcAttribute -VpcId vpc-12345678 -Attribute enableDnsHostnames

Output:

EnableDnsHostnames ------------------ True

Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, consulta. Crea EC2 risorse Amazon utilizzando un AWS SDK Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.