| Removed in Ansible: | |
|---|---|
| version: 1.5.0 | |
| Why: | Alibaba Cloud module name prefix “ali” will be more concise. |
| Alternative: | Use ali_instance_type_facts instead. |
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| alicloud_access_key |
Aliyun Cloud access key. If not set then the value of environment variable
ALICLOUD_ACCESS_KEY, ALICLOUD_ACCESS_KEY_ID will be used instead.aliases: access_key_id, access_key |
|
| alicloud_region |
The Aliyun Cloud region to use. If not specified then the value of environment variable
ALICLOUD_REGION, ALICLOUD_REGION_ID will be used instead.aliases: region, region_id |
|
| alicloud_secret_key |
Aliyun Cloud secret key. If not set then the value of environment variable
ALICLOUD_SECRET_KEY, ALICLOUD_SECRET_ACCESS_KEY will be used instead.aliases: secret_access_key, secret_key |
|
| alicloud_security_token |
The Aliyun Cloud security token. If not specified then the value of environment variable
ALICLOUD_SECURITY_TOKEN will be used instead.aliases: security_token |
|
| alicloud_zone |
The Zone that supports available instance types.
aliases: zone_id, zone |
|
| cpu_core_count |
Cpu core count of instance type.
aliases: cpu_count |
|
| instance_type_families |
List family names of instance types.
aliases: families |
|
| instance_type_ids |
List Ids of instance types.
aliases: ids |
|
| memory_size |
Memory size of instance type.
aliases: memory |
Note
ALICLOUD_ACCESS_KEY or ALICLOUD_ACCESS_KEY_ID, ALICLOUD_SECRET_KEY or ALICLOUD_SECRET_ACCESS_KEY, ALICLOUD_REGION or ALICLOUD_REGION_ID, ALICLOUD_SECURITY_TOKENALICLOUD_REGION or ALICLOUD_REGION_ID can be typically be used to specify the ALICLOUD region, when required, but this can also be configured in the footmark config file# Fetch instance types according to setting different filters
- name: fetch instance types example
hosts: localhost
vars:
alicloud_access_key: <your-alicloud-access-key>
alicloud_secret_key: <your-alicloud-secret-key>
alicloud_region: cn-beijing
alicloud_zone: cn-beijing-a
tasks:
- name: Find all instance types in the specified region
alicloud_instance_type_facts:
alicloud_region: '{{ alicloud_region }}'
register: all_instance_types
- name: Find all instance types based on the specified zone
alicloud_instance_type_facts:
alicloud_region: '{{ alicloud_region }}'
alicloud_zone: '{{ alicloud_zone }}'
register: instance_types_by_zone
- name: Find all instance types based on the specified family names
alicloud_instance_type_facts:
alicloud_region: '{{ alicloud_region }}'
instance_type_families:
- "ecs.gn5"
- "ecs.sn2ne"
register: instance_types_by_families
- name: Find all instance types based on the specified ids
alicloud_instance_type_facts:
alicloud_region: '{{ alicloud_region }}'
instance_type_ids:
- "ecs.se1ne.14xlarge"
- "ecs.m2.xlarge"
register: instance_types_by_ids
- name: Find all instance types based on the specified cpu core count
alicloud_instance_type_facts:
alicloud_region: '{{ alicloud_region }}'
cpu_core_count: 56
register: instance_types_by_cpu
- name: Find all instance types based on the specified memory size
alicloud_instance_type_facts:
alicloud_region: '{{ alicloud_region }}'
memory_size: 64.0
register: instance_types_by_memory
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
instance_type_ids
list
|
when success |
List ids of the instance types.
Sample:
['ecs.m1.medium', 'ecs.m1.xlarge']
|
|
instance_types
list
|
when success |
Details about the ecs instance types.
Sample:
[{'instance_type_family': 'ecs.m1', 'memory_size': 16.0, 'id': 'ecs.m1.medium', 'cpu_core_count': 4}, {'instance_type_family': 'ecs.m1', 'memory_size': 32.0, 'id': 'ecs.m1.xlarge', 'cpu_core_count': 8}]
|
|
total
int
|
when success |
The number of all instance types.
Sample:
2
|
This module is flagged as deprecated and will be removed in version 1.5.0. For more information see DEPRECATED.
Hint
If you notice any issues in this documentation you can edit this document to improve it.