Use DescribeAccountAttributes with a CLI
The following code examples show how to use DescribeAccountAttributes.
- CLI
-
- AWS CLI
-
Example 1: To describe all the attributes for your AWS account
The following
describe-account-attributesexample describes the attributes for your AWS account.aws ec2 describe-account-attributesOutput:
{ "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" } ] } ] }For more information, see Amazon EC2 service quotas
in the Amazon EC2 User Guide. Example 2: To describe a single attribute for your AWS account
The following
describe-account-attributesexample describes thesupported-platformsattribute for your AWS account.aws ec2 describe-account-attributes \ --attribute-namessupported-platformsOutput:
{ "AccountAttributes": [ { "AttributeName": "supported-platforms", "AttributeValues": [ { "AttributeValue": "EC2" }, { "AttributeValue": "VPC" } ] } ] }For more information, see Amazon EC2 service quotas
in the Amazon EC2 User Guide. -
For API details, see DescribeAccountAttributes
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example describes whether you can launch instances into EC2-Classic and EC2-VPC in the region, or only into EC2-VPC.
(Get-EC2AccountAttribute -AttributeName supported-platforms).AttributeValuesOutput:
AttributeValue -------------- EC2 VPCExample 2: This example describes your default VPC, or is 'none' if you do not have a default VPC in the region.
(Get-EC2AccountAttribute -AttributeName default-vpc).AttributeValuesOutput:
AttributeValue -------------- vpc-12345678Example 3: This example describes the maximum number of On-Demand instances that you can run.
(Get-EC2AccountAttribute -AttributeName max-instances).AttributeValuesOutput:
AttributeValue -------------- 20-
For API details, see DescribeAccountAttributes
in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example describes whether you can launch instances into EC2-Classic and EC2-VPC in the region, or only into EC2-VPC.
(Get-EC2AccountAttribute -AttributeName supported-platforms).AttributeValuesOutput:
AttributeValue -------------- EC2 VPCExample 2: This example describes your default VPC, or is 'none' if you do not have a default VPC in the region.
(Get-EC2AccountAttribute -AttributeName default-vpc).AttributeValuesOutput:
AttributeValue -------------- vpc-12345678Example 3: This example describes the maximum number of On-Demand instances that you can run.
(Get-EC2AccountAttribute -AttributeName max-instances).AttributeValuesOutput:
AttributeValue -------------- 20-
For API details, see DescribeAccountAttributes
in AWS Tools for PowerShell Cmdlet Reference (V5).
-
For a complete list of AWS SDK developer guides and code examples, see Create Amazon EC2 resources using an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.