Author: | Gareth Rushgrove |
---|
New in version 1.6.
Can create or delete AWS Autoscaling Groups Works with the ec2_lc module to manage Launch Configurations
parameter | required | default | choices | comments |
---|---|---|---|---|
availability_zones | no | List of availability zone names in which to create the group. Defaults to all the availability zones in the region if vpc_zone_identifier is not set. | ||
aws_access_key | no | AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used. | ||
aws_secret_key | no | AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used. | ||
desired_capacity | no | Desired number of instances in group | ||
ec2_url | no | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Must be specified if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used | ||
health_check_period | no | 500 seconds | Length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health. (added in Ansible 1.7) | |
health_check_type | no | EC2 |
|
The service you want the health status from, Amazon EC2 or Elastic Load Balancer. (added in Ansible 1.7) |
launch_config_name | no | Name of the Launch configuration to use for the group. See the ec2_lc module for managing these. | ||
load_balancers | no | List of ELB names to use for the group | ||
max_size | no | Maximum number of instances in group | ||
min_size | no | Minimum number of instances in group | ||
name | yes | Unique name for group to be created or deleted | ||
profile | no | uses a boto profile. Only works with boto >= 2.24.0 (added in Ansible 1.6) | ||
region | no | The AWS region to use. If not specified then the value of the EC2_REGION environment variable, if any, is used. | ||
security_token | no | security token to authenticate against AWS (added in Ansible 1.6) | ||
state | yes |
|
register or deregister the instance | |
tags | no | None | A list of tags to add to the Auto Scale Group. Optional key is 'propagate_at_launch', which defaults to true. (added in Ansible 1.7) | |
validate_certs | no | yes |
|
When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. (added in Ansible 1.5) |
vpc_zone_identifier | no | None | List of VPC subnets to use |
Note
Requires boto
- ec2_asg:
name: special
load_balancers: 'lb1,lb2'
availability_zones: 'eu-west-1a,eu-west-1b'
launch_config_name: 'lc-1'
min_size: 1
max_size: 10
desired_capacity: 5
vpc_zone_identifier: 'subnet-abcd1234,subnet-1a2b3c4d'
tags:
- environment: production
propagate_at_launch: no
deprecated method of expressing tags:
tags:
- key: environment
value: production
propagate_at_launch: no
Note
The following environment variables can be used AWS_ACCESS_KEY or EC2_ACCESS_KEY or AWS_ACCESS_KEY_ID, AWS_SECRET_KEY or EC2_SECRET_KEY or AWS_SECRET_ACCESS_KEY, AWS_REGION or EC2_REGION, AWS_SECURITY_TOKEN
Note
Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See http://boto.readthedocs.org/en/latest/boto_config_tut.html
Note
AWS_REGION or EC2_REGION can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file