AWS - Create a Dynamic Inventory

Create a dynamic inventory of the deployed hosts on AWS.

We'll cover the following

Ansible has a built-in inventory plugin for AWS called aws_ec2. The plugin queries AWS for EC2 instance details and constructs an Ansible inventory from that information. The inventory’s hosts are populated by the EC2 instances that are returned. Group and group memberships are determined by the host variables that are assigned to each host.

We ceate a file named hosts_aws_ec2.yml and define the aws_ec2 settings.

Get hands-on with 1200+ tech skills courses.