Giter VIP home page Giter VIP logo

ansible-aws-vpc's Introduction

ansible-aws-vpc

Create a VPC in AWS using Ansible

These ansible playbook creates a simple VPC. The AWS VPC created will include the following components

  1. vpc (vpc_net)
  2. subnet (ec2_vpc_subnet)
  3. router (ec2_vpc_router_table)
  4. internet gateway (ec2_vpc_igw)
  5. security group (ec2_group)
  6. ec2 instance (ec2)

Prequisites:

  • IAM User with the required permission
  • Boto installed (Ansible uses the Boto Python library to handle AWS management)

1. VPC:

To create a VPC, we have to use the ec2_vpc_net module. We will register the module returned data in the “vpc” variable

2. Creating a subnet and associating it with an Internet Gateway

We need an IGW so that our public subnet can access the internet. In our subnet, we have set map_public to “YES”. This means instances created in this subnet is associated with a public IP address.

3. Routing traffic to IGW and creating a security group

Here, we would need to route the traffic to the IGW via the route table and create a security group.

4. Creating an EC2 Key Pair and an EC2 instance

Create an EC2 Key Pair and an EC2 instance.

Key points:

  • if you already have an EC2 key pair, skip the EC2 key pair and update the key_name with the name of the key pair
  • exact_count is important! It determines the number of instances is created
  • Image ID can be found on AWS Marketplace

End of Doc

ansible-aws-vpc's People

Contributors

sujoyshub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.