New in version 1.5.0.
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 |
|
| creation_type |
|
ECS instance creation type. Valid when
state='absent', instance_ids=None. 'AutoCreated' for the ECS instance is automatically created by the Auto Scaling service in the scaling group. 'Attached' for the ECS instance is created outside the Auto Scaling service and manually attached to the scaling group.aliases: type |
|
group_id
required |
The ID of a scaling group.
|
|
| instance_ids |
ID list of an ECS instance. At most 20 ECS instance supported. Required when
state='present'. |
|
| state |
|
present to add ECS instances; absent to remove ECS instances.
|
Note
state=absent.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# basic provisioning example scaling instance
- name: basic provisioning example
hosts: localhost
vars:
alicloud_access_key: <your-alicloud-access-key-id>
alicloud_secret_key: <your-alicloud-access-secret-key>
alicloud_region: cn-beijing
instance_ids:
- "i-2ze2y4x26l66h4b4u884"
- "i-2ze0eyu760pkh468uwg7"
group_id: asg-2zebnrbt206pex
tasks:
- name: add instances to specified
ali_ess_instance:
alicloud_region: '{{ alicloud_region }}'
instance_ids: '{{ instance_ids }}'
group_id: '{{ group_id }}'
- name: remove auto-created instances
ali_ess_instance:
alicloud_region: '{{ alicloud_region }}'
creation_type: 'AutoCreated'
group_id: '{{ group_id }}'
state: absent
- name: remove all of ECS instances
ali_ess_instance:
alicloud_region: '{{ alicloud_region }}'
group_id: '{{ group_id }}'
state: absent
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
changed
bool
|
when success |
The result of adding or removing.
Sample:
True
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.