Usar DescribeAccountAttributes com uma CLI - Exemplos de código do AWS SDK

Há mais exemplos do AWS SDK disponíveis no repositório do GitHub Documento de Exemplos do AWS SDK.

Usar DescribeAccountAttributes com uma CLI

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

CLI
AWS CLI

Descrever todos os atributos da sua conta AWS

Este exemplo descreve os atributos da sua conta da AWS.

Comando:

aws ec2 describe-account-attributes

Saída:

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

Descrever um único atributo para sua conta AWS

Este exemplo descreve o atributo supported-platforms da sua conta da AWS.

Comando:

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

Saída:

{ "AccountAttributes": [ { "AttributeName": "supported-platforms", "AttributeValues": [ { "AttributeValue": "EC2" }, { "AttributeValue": "VPC" } ] } ] }
PowerShell
Ferramentas para PowerShell V4

Exemplo 1: esse exemplo descreve se você pode executar instâncias no EC2-Classic e no EC2-VPC na região ou somente no EC2-VPC.

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

Saída:

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

Exemplo 2: esse exemplo descreve a VPC padrão ou indica “nenhuma” caso você não tenha uma VPC padrão na região.

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

Saída:

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

Exemplo 3: esse exemplo descreve o número máximo de instâncias sob demanda que você pode executar.

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

Saída:

AttributeValue -------------- 20
Ferramentas para PowerShell V5

Exemplo 1: esse exemplo descreve se você pode executar instâncias no EC2-Classic e no EC2-VPC na região ou somente no EC2-VPC.

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

Saída:

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

Exemplo 2: esse exemplo descreve a VPC padrão ou indica “nenhuma” caso você não tenha uma VPC padrão na região.

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

Saída:

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

Exemplo 3: esse exemplo descreve o número máximo de instâncias sob demanda que você pode executar.

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

Saída:

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