Utilizzo DescribeAccountAttributes con un AWS SDK o 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à.

Utilizzo DescribeAccountAttributes con un AWS SDK o una CLI

I seguenti esempi di codice mostrano come utilizzareDescribeAccountAttributes.

CLI
AWS CLI

Per descrivere tutti gli attributi del tuo account AWS

Questo esempio descrive gli attributi del tuo AWS account.

Comando:

aws ec2 describe-account-attributes

Output:

{ "AccountAttributes": [ { "AttributeName": "vpc-max-security-groups-per-interface", "AttributeValues": [ { "AttributeValue": "5" } ] }, { "AttributeName": "max-instances", "AttributeValues": [ { "AttributeValue": "20" } ] }, { "AttributeName": "supported-platforms", "AttributeValues": [ { "AttributeValue": "EC2" }, { "AttributeValue": "VPC" } ] }, { "AttributeName": "default-vpc", "AttributeValues": [ { "AttributeValue": "none" } ] }, { "AttributeName": "max-elastic-ips", "AttributeValues": [ { "AttributeValue": "5" } ] }, { "AttributeName": "vpc-max-elastic-ips", "AttributeValues": [ { "AttributeValue": "5" } ] } ] }

Per descrivere un singolo attributo del tuo AWS account

Questo esempio descrive l'supported-platformsattributo del tuo AWS account.

Comando:

aws ec2 describe-account-attributes --attribute-names supported-platforms

Output:

{ "AccountAttributes": [ { "AttributeName": "supported-platforms", "AttributeValues": [ { "AttributeValue": "EC2" }, { "AttributeValue": "VPC" } ] } ] }
PowerShell
Strumenti per PowerShell

Esempio 1: Questo esempio descrive se è possibile avviare istanze in EC2-Classic ed EC2-VPC nella regione o solo in EC2-VPC.

(Get-EC2AccountAttribute -AttributeName supported-platforms).AttributeValues

Output:

AttributeValue -------------- EC2 VPC

Esempio 2: Questo esempio descrive il tuo VPC predefinito o è «nessuno» se non hai un VPC predefinito nella regione.

(Get-EC2AccountAttribute -AttributeName default-vpc).AttributeValues

Output:

AttributeValue -------------- vpc-12345678

Esempio 3: questo esempio descrive il numero massimo di istanze On-Demand che è possibile eseguire.

(Get-EC2AccountAttribute -AttributeName max-instances).AttributeValues

Output:

AttributeValue -------------- 20

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