Skip to content

Repository files navigation

Amazon AWS Collection

The Ansible Amazon AWS collection includes a variety of Ansible content to help automate the management of AWS instances. This collection is maintained by the Ansible cloud team.

AWS related modules and plugins supported by the Ansible community are in the community.aws collection.

Ansible version compatibility

This collection has been tested against following Ansible versions: >=2.9.10.

Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. PEP440 is the schema used to describe the versions of Ansible.

Python version compatibility

As the AWS SDK for Python (Boto3 and Botocore) has ceased supporting Python 2.7, this collection requires Python 3.6 or greater.

Starting with the 2.0.0 releases of amazon.aws and community.aws, it is generally the collection's policy to support the versions of botocore and boto3 that were released 12 months prior to the most recent major collection release, following semantic versioning (for example, 2.0.0, 3.0.0).

Version 2.0.0 of this collection supports boto3 >= 1.13.0 and botocore >= 1.16.0

Included content

Inventory plugins

NameDescription
amazon.aws.aws_ec2EC2 inventory source
amazon.aws.aws_rdsrds instance source

Lookup plugins

NameDescription
amazon.aws.aws_account_attributeLook up AWS account attributes.
amazon.aws.aws_secretLook up secrets stored in AWS Secrets Manager.
amazon.aws.aws_service_ip_rangesLook up the IP ranges for services provided in AWS such as EC2 and S3.
amazon.aws.aws_ssmGet the value for a SSM parameter or all parameters under a path.

Modules

NameDescription
amazon.aws.aws_az_infoGather information about availability zones in AWS.
amazon.aws.aws_caller_infoGet information about the user and account being used to make AWS calls.
amazon.aws.aws_s3manage objects in S3.
amazon.aws.cloudformationCreate or delete an AWS CloudFormation stack
amazon.aws.cloudformation_infoObtain information about an AWS CloudFormation stack
amazon.aws.ec2create, terminate, start or stop an instance in ec2
amazon.aws.ec2_amiCreate or destroy an image (AMI) in ec2
amazon.aws.ec2_ami_infoGather information about ec2 AMIs
amazon.aws.ec2_elb_lbCreates, updates or destroys an Amazon ELB.
amazon.aws.ec2_eniCreate and optionally attach an Elastic Network Interface (ENI) to an instance
amazon.aws.ec2_eni_infoGather information about ec2 ENI interfaces in AWS
amazon.aws.ec2_groupmaintain an ec2 VPC security group.
amazon.aws.ec2_group_infoGather information about ec2 security groups in AWS.
amazon.aws.ec2_keycreate or delete an ec2 key pair
amazon.aws.ec2_metadata_factsgathers facts (instance metadata) about remote hosts within EC2
amazon.aws.ec2_snapshotCreates a snapshot from an existing volume
amazon.aws.ec2_snapshot_infoGather information about ec2 volume snapshots in AWS
amazon.aws.ec2_tagcreate and remove tags on ec2 resources
amazon.aws.ec2_tag_infolist tags on ec2 resources
amazon.aws.ec2_volCreate and attach a volume, return volume id and device map
amazon.aws.ec2_vol_infoGather information about ec2 volumes in AWS
amazon.aws.ec2_vpc_dhcp_optionManages DHCP Options, and can ensure the DHCP options for the given VPC match what's requested
amazon.aws.ec2_vpc_dhcp_option_infoGather information about dhcp options sets in AWS
amazon.aws.ec2_vpc_netConfigure AWS virtual private clouds
amazon.aws.ec2_vpc_net_infoGather information about ec2 VPCs in AWS
amazon.aws.ec2_vpc_subnetManage subnets in AWS virtual private clouds
amazon.aws.ec2_vpc_subnet_infoGather information about ec2 VPC subnets in AWS
amazon.aws.s3_bucketManage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID

Installing this collection

You can install the AWS collection with the Ansible Galaxy CLI:

ansible-galaxy collection install amazon.aws

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
- name: amazon.aws

The python module dependencies are not installed by ansible-galaxy. They can be manually installed using pip:

pip install requirements.txt

or:

pip install boto boto3 botocore

Using this collection

You can either call modules by their Fully Qualified Collection Namespace (FQCN), such as amazon.aws.ec2_instance, or you can call modules by their short name if you list the amazon.aws collection in the playbook's collections keyword:

---
- name: Setup an instance for testingamazon.aws.ec2_instance:
name: '{{ resource_prefix }}'instance_type: t2.nanoimage_id: "{{ (amis.images | sort(attribute='creation_date') | last).image_id }}"wait: yesvolumes:
- device_name: /dev/xvdaebs:
volume_size: 8delete_on_termination: trueregister: instance

NOTE: For Ansible 2.9, you may not see deprecation warnings when you run your playbooks with this collection. Use this documentation to track when a module is deprecated.

See Also:

Contributing to this collection

We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against the Amazon AWS collection repository. See Contributing to Ansible-maintained collections for more details.

You can also join us on:

More information about contributing

Release notes

Roadmap

More information

Licensing

GNU General Public License v3.0 or later.

See COPYING to see the full text.

About

Ansible Collection for Amazon AWS

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages