| Removed in Ansible: | |
|---|---|
| version: 1.5.0 | |
| Why: | Alibaba Cloud module name prefix “ali” will be more concise. |
| Alternative: | Use ali_ess_rule instead. |
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| adjustment_type |
|
Adjustment mode of a scaling rule.
QuantityChangeInCapacity used to increase or decrease a specified number of ECS instances;
PercentChangeInCapacity used to increase or decrease a specified proportion of ECS instances;
TotalCapacity used to adjust the quantity of ECS instances in the current scaling group to a specified value.
Required when
state=present.aliases: type |
| adjustment_value |
Adjusted value of a scaling rule.
QuantityChangeInCapacity to (0, 100] U (-100, 0];
PercentChangeInCapacity to [0, 10000] U [-10000, 0];
TotalCapacity to [0, 100].
Required when
state=present.aliases: value |
|
| 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 |
|
| cooldown |
Cool-down time of a scaling rule. Value range to [0, 86400], in seconds. The default value is empty.
|
|
| group_id |
ID of the scaling group of a scaling rule. Required when
state=present.aliases: scaling_group_id |
|
| id |
The ID of existing scaling rule.
aliases: rule_id |
|
| name |
The name of scaling rule.
It must contain 2-40 English or Chinese characters, and start with a number, a letter in upper or lower case or a Chinese character, and it can contain numbers, "_", "-" or ".".
Default to scaling rule Id.
aliases: rule_name |
|
| state |
|
present to create a scaling rule and absent to delete it.
|
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- name: basic example
hosts: localhost
vars:
alicloud_access_key: <your-alicloud-access-key-id>
alicloud_secret_key: <your-alicloud-access-secret-key>
alicloud_region: cn-beijing
cooldown: 400
group_id: asg-2zeimuvzeil1xfuor9ej
name: ess-rule-foo
adjustment_type: QuantityChangeInCapacity
adjustment_value: 3
tasks:
- name: launch scaling rule
alicloud_ess_rule:
alicloud_access_key: '{{ alicloud_access_key }}'
alicloud_secret_key: '{{ alicloud_secret_key }}'
alicloud_region: '{{ alicloud_region }}'
group_id: '{{ essgroup.id }}'
adjustment_type: '{{adjustment_type}}'
adjustment_value: '{{adjustment_value}}'
cooldown: '{{cooldown}}'
name: '{{name}}'
- name: delete specified scaling rule
alicloud_ess_rule:
alicloud_access_key: '{{ alicloud_access_key }}'
alicloud_secret_key: '{{ alicloud_secret_key }}'
alicloud_region: '{{ alicloud_region }}'
name: '{{ name }}'
state: absent
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
group_id
str
|
expect absent |
ID of the scaling group of a scaling rule.
Sample:
asg-2zeimuvzeil1xfuor9ej
|
|
id
str
|
expect absent |
Scaling Rule ID.
Sample:
asr-2zefe4bi0jpctd6z726p
|
|
name
str
|
expect absent |
Scaling Rule name.
Sample:
ess-rule-foo
|
|
rule
dict
|
expect absent |
The details of a scaling rule.
Sample:
{'adjustment_value': 3, 'cooldown': 400, 'name': 'from-ansible-roles-test_ess', 'ari': 'ari:acs:ess:cn-beijing:1204663572767468:scalingrule/asr-2zefe4bi0jpctd6z726p', 'adjustment_type': 'QuantityChangeInCapacity', 'group_id': 'asg-2zegiwc8m3ccxj0y1rbq', 'id': 'asr-2zefe4bi0jpctd6z726p'}
|
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.