amazon.aws.ec2_instance_type_info module – Retrieve information about EC2 instance types
Note
This module is part of the amazon.aws collection (version 11.3.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install amazon.aws.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: amazon.aws.ec2_instance_type_info.
New in amazon.aws 11.1.0
Synopsis
Retrieves detailed information about EC2 instance types.
By default, all instance types for the current region are described.
Can filter results using instance type names or filters.
Does not implement DryRun feature.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.6
boto3 >= 1.35.0
botocore >= 1.35.0
Parameters
Parameter |
Comments |
|---|---|
AWS access key ID. See the AWS documentation for more information about access tokens https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys. The The aws_access_key and profile options are mutually exclusive. The aws_access_key_id alias was added in release 5.1.0 for consistency with the AWS botocore SDK. |
|
The location of a CA Bundle to use when validating SSL certificates. The |
|
A dictionary to modify the botocore configuration. Parameters can be found in the AWS documentation https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config. |
|
Use a The Choices:
|
|
URL to connect to instead of the default AWS endpoints. While this can be used to connection to other AWS-compatible services the amazon.aws and community.aws collections are only tested against AWS. The |
|
A dict of filters to apply. Each dict item consists of a filter key and a filter value. See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstanceTypes.html for possible filters. Filter names and values are case sensitive. Filter values support wildcards (e.g., Default: |
|
List of instance types to describe. Must be exact instance type names (e.g., For wildcard matching, use the Maximum of 100 instance types. If not provided, all instance types are returned. Default: |
|
A named AWS profile to use for authentication. See the AWS documentation for more information about named profiles https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html. The The profile option is mutually exclusive with the aws_access_key, aws_secret_key and session_token options. |
|
The AWS region to use. For global services such as IAM, Route53 and CloudFront, region is ignored. The See the Amazon AWS documentation for more information http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region. |
|
AWS secret access key. See the AWS documentation for more information about access tokens https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys. The The secret_key and profile options are mutually exclusive. The aws_secret_access_key alias was added in release 5.1.0 for consistency with the AWS botocore SDK. |
|
AWS STS session token for use with temporary credentials. See the AWS documentation for more information about access tokens https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys. The The session_token and profile options are mutually exclusive. |
|
When set to Setting validate_certs=false is strongly discouraged, as an alternative, consider setting aws_ca_bundle instead. Choices:
|
Notes
Note
Caution: For modules, environment variables and configuration files are read from the Ansible ‘host’ context and not the ‘controller’ context. As such, files may need to be explicitly copied to the ‘host’. For lookup and connection plugins, environment variables and configuration files are read from the Ansible ‘controller’ context and not the ‘host’ context.
The AWS SDK (boto3) that Ansible uses may also read defaults for credentials and other settings, such as the region, from its configuration files in the Ansible ‘host’ context (typically
~/.aws/credentials). See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html for more information.
Examples
- name: Get information about all instance types
amazon.aws.ec2_instance_type_info:
register: all_instance_types
- name: Get information about specific instance types
ec2_instance_type_info:
instance_types:
- t3.micro
- t3.small
- t3.medium
register: t3_types
- name: Get all c5 instance types using wildcard filter
amazon.aws.ec2_instance_type_info:
filters:
instance-type:
- "c5.*"
register: c5_types
- name: Filter for current generation instance types with GPU
amazon.aws.ec2_instance_type_info:
filters:
current-generation:
- "true"
instance-type:
- "p3.*"
register: gpu_types
- name: Filter for bare metal instance types
amazon.aws.ec2_instance_type_info:
filters:
bare-metal:
- "true"
register: bare_metal_types
- name: Filter by processor architecture
amazon.aws.ec2_instance_type_info:
filters:
processor-info.supported-architecture:
- arm64
register: arm_types
- name: Filter for free tier eligible instances
amazon.aws.ec2_instance_type_info:
filters:
free-tier-eligible:
- "true"
register: free_tier_types
- name: Combine multiple filters (m5 family with 4 vCPUs)
amazon.aws.ec2_instance_type_info:
filters:
instance-type:
- "m5.*"
vcpu-info.default-vcpus:
- "4"
register: m5_4vcpu_types
- name: Filter with multiple values
amazon.aws.ec2_instance_type_info:
filters:
processor-info.supported-architecture:
- arm64
- x86_64
register: multi_arch_types
- name: Combine specific instance types with filters
amazon.aws.ec2_instance_type_info:
instance_types:
- t3.micro
- t3.small
- t3.medium
filters:
processor-info.supported-architecture:
- x86_64
register: filtered_t3_types
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
List of instance type information objects. Returned: always |
|
Whether auto recovery is supported. Returned: always |
|
Whether this is a bare metal instance type. Returned: always |
|
Whether burstable performance is supported. Returned: always |
|
Whether the instance type is current generation. Returned: always |
|
Whether dedicated hosts are supported. Returned: always |
|
EBS information. Returned: always |
|
EBS optimized performance info. Returned: success |
|
EBS optimized support status. Returned: success |
|
EBS encryption support status. Returned: success |
|
NVMe support status. Returned: success |
|
FPGA information. Returned: when FPGA is available |
|
Whether the instance type is eligible for the free tier. Returned: always |
|
GPU information. Returned: when GPU is available |
|
List of GPU devices. Returned: success |
|
Total GPU memory in MiB. Returned: success |
|
Whether hibernation is supported. Returned: always |
|
The hypervisor type (nitro, xen). Returned: when available |
|
Inference accelerator information. Returned: when inference accelerators are available |
|
Instance storage information. Returned: when instance_storage_supported is true |
|
List of instance storage disks. Returned: success |
|
Encryption support status. Returned: success |
|
NVMe support status. Returned: success |
|
Total instance storage size in GB. Returned: success |
|
Whether instance storage is supported. Returned: always |
|
The instance type identifier. Returned: always Sample: |
|
Memory information. Returned: always |
|
Memory size in MiB. Returned: success |
|
Network information. Returned: always |
|
Whether EFA is supported. Returned: success |
|
ENA support status. Returned: success |
|
Whether encryption in transit is supported. Returned: success |
|
Maximum IPv4 addresses per interface. Returned: success |
|
Maximum IPv6 addresses per interface. Returned: success |
|
Whether IPv6 is supported. Returned: success |
|
Maximum number of network cards. Returned: success |
|
Maximum number of network interfaces. Returned: success |
|
Network performance description. Returned: success |
|
Nitro Enclaves support status. Returned: when available |
|
NitroTPM information. Returned: when NitroTPM is supported |
|
NitroTPM support status. Returned: when available |
|
Placement group information. Returned: always |
|
Supported placement strategies. Returned: success |
|
Processor information. Returned: always |
|
Supported CPU architectures. Returned: success |
|
Sustained clock speed in GHz. Returned: success |
|
Supported boot modes (legacy-bios, uefi). Returned: always |
|
Supported root device types (ebs, instance-store). Returned: always |
|
Usage classes supported (on-demand, spot, capacity-block). Returned: always |
|
Supported virtualization types (hvm, paravirtual). Returned: always |
|
vCPU information. Returned: always |
|
Default number of cores. Returned: success |
|
Default threads per core. Returned: success |
|
Default number of vCPUs. Returned: success |
|
List of valid core counts. Returned: success |
|
List of valid thread per core counts. Returned: success |