| Removed in Ansible: | |
|---|---|
| version: 1.5.0 | |
| Why: | Alibaba Cloud module name prefix “ali” will be more concise. |
| Alternative: | Use ali_ess_group 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 |
|
| configuration_id |
ID of the active scaling configuration in the scaling group. Required when
state=active.aliases: scaling_configuration_id |
|
| cooldown |
Default: 300
|
Default cool-down time (in seconds) of the scaling group. Value range [0, 86400].
aliases: default_cooldown |
| db_instance_ids |
ID list of an RDS instance. At most 8 RDS instance supported.
aliases: db_ids |
|
| id |
The ID of existing scaling group.
aliases: group_id |
|
| load_balancer_ids |
ID list of a Server Load Balancer instance. At most 5 Load Balancer instance supported.
aliases: lb_ids |
|
| max_size |
Maximum number of ECS instances in the scaling group. Value range [0, 100].
|
|
| min_size |
Minimum number of ECS instances in the scaling group. Value range [0, 100]. Required when
state=present. |
|
| name |
Name shown for the scaling group, which must contain 2-40 characters (English or Chinese). The name must begin with a number, an upper/lower-case letter or a Chinese character and may contain numbers, "_", "-" or ".". Default to scaling group ID.
aliases: group_name |
|
| removal_policies |
[u'OldestScalingConfiguration', u'OldestInstance']
|
Policy for removing ECS instances from the scaling group. Optional values OldestInstance(removes the first ECS instance attached to the scaling group); NewestInstance(removes the first ECS instance attached to the scaling group); OldestScalingConfiguration(removes the ECS instance with the oldest scaling configuration).
|
| state |
|
The state of the scaling group after operating.
|
| vswitch_ids |
ID list of a VSwitch. At most 8 vswitch supported. The priority of VSwitches descends from 1 to 5, and 1 indicates the highest priority.
aliases: subnet_ids |
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# basic provisioning example scaling group
- 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
ess_group_name: foo
max_size: 2
min_size: 0
cooldown: 400
removal_policies:
- 'OldestScalingConfiguration'
- 'OldestInstance'
group_id: asg-fh323iwefncew31
configuration_id: asc-2ze4zleeettwd4sfnrkk
tasks:
- name: Create scaling group
alicloud_ess_group:
alicloud_region: '{{ alicloud_region }}'
max_size: '{{ max_size }}'
min_size: '{{ min_size }}'
name: '{{ ess_group_name }}'
vswitch_ids:
- '{{ subnet.vswitch_id }}'
- name: active a specified scaling group
alicloud_ess_group:
alicloud_region: '{{ alicloud_region }}'
configuration_id: '{{ configuration.id }}'
id: '{{ group_id }}'
state: active
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
configuration_id
str
|
expect absent |
ID of the active scaling configuration in the scaling group.
Sample:
asc-2ze4zleeettwd4sfnrkk
|
|
group
dict
|
expect absent |
The details of a scaling group.
Sample:
{'status': 'active', 'name': 'foo', 'db_ids': None, 'creation_time': '2018-01-08T05:42Z', 'configuration_id': 'asc-2ze4zleeettwd4sfnrkk', 'min_size': 0, 'cooldown': 300, 'load_balancer_id': None, 'vswitch_ids': ['vsw-2zevfsoh2v7en50w9up6u'], 'id': 'asg-2zefe4bi0jpc3tqi8mn8', 'max_size': 2}
|
|
id
str
|
expect absent |
The ID of existing scaling group.
Sample:
asg-2zefe4bi0jpc3tqi8mn8
|
|
name
str
|
expect absent |
The ID of existing scaling group.
Sample:
foo
|
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.