The Ansible development environment in AWS will comprise the following:

  • A Virtual Private Cloud(VPC)
  • A subnet
  • An internet gateway
  • A route for public traffic into the VPC
  • Windows EC2 instance with Windows Server 2019 Amazon Machine Image(AMI)
  • Linux EC2 instance with Red Hat Enterprise Linux 8 Amazon Machine Image(AMI)

Free Tier

Both the AMIs used are within the free tier.

Ansible Modules

The following Ansible Modules can be used to deploy the resources on AWS using Ansible playbooks:

AWS Resource Ansible Module
VPC ec2_vpc_net
Subnet ec2_vpc_subnet
Internet Gateway ec2_vpc_igw
Route Table ec2_vpc_route_table
Security Group ec2_group
Key Pair ec2_key
EC2 Instance ec2
Elastic IP Address ec2_eip

Ansible codifies your infrastructure in YAML files called Ansible playbooks. You will use pre-written Ansible playbooks to deploy the Ansible development environment to AWS.

Resource Dependency
Several of the AWS resources depend on other resources. These dependencies mean that you have to run the playbooks in the right order.

Let’s start exploring the playbooks we will cover in this lesson one by one:

Create a VPC

Before you can deploy an Elastic Compute Cloud(EC2) instance, you have to provision a VPC. You will provision a VPC with a subnet, an internet gateway, and a route table entry for public traffic. Review the aws_create_vpc.yaml playbook below:

Get hands-on with 1200+ tech skills courses.