Giter Club home page Giter Club logo

aws-natgw's Introduction

aws-natgw

Will create a NAT gateway(s) in an existing VPC

Requirements

  • AWS credentials and the correct permissions to create the resources
  • An existing VPC with a tagged Name
  • Existing public subnets that are Tagged with the word Public in their name
  • Existing private subnets that are Tagged with the word Private in their name

Role Variables

The variables uses in this role are

Variable Name Required Description
region Yes The region that you will deploy into
vpc_name Yes Used for Rollback purposes
natgw_wait_timeout Optional Period of time to wait for timeout
- Default 300
natgw_wait Optional Wait for subnet to become available
- Default yes
map_public Optional Assign public IP addresses by default to instances
- Default no
if_exist_do_not_create Optional Do not create a NAT gateway if one already exists in that subnet
- Default true
eip_address Optional Elastic IP to attach to the NAT Gateway
- Default empty - a new Elastic IP will be created
release_eip Optional Relase Elastic IP after NAT Gateway Removal
- Default yes

Dependencies

None

Example Playbook

Download dependencies

Create requirements file

Create a requirements.yml file with the following contents

- src: https://github.com/maishsk/aws-natgw
  version: master

Download dependencies

Run the following command:

ansible-galaxy install -r requirements.yml --force -p .

Create playbook

Create a main.yaml file with the following contents:

---
- name: NAT Gateway Provisioning
  hosts: localhost
  connection: local
  gather_facts: false
  vars_files:
    - vars.yml

  tasks:
  - name: Create Process
    include_role:
      name: "{{ item }}"
    with_items:
      - aws-natgw
    tags: [ 'never', 'create' ]

  - name: Rollback Process
    include_role:
      name: "{{ item }}"
    with_items:
      - aws-natgw
    tags: [ 'never', 'rollback' ]

Create a vars/vars.yml with the content similar to:

vpc_name: maish_test
region: us-east-2

Running the playbook

To create the NAT Gateways

ansible-playbook main.yml --tags create

To remove the NAT Gateways

ansible-playbook main.yml --tags rollback

License

BSD

Author Information

This role was created by Maish Saidel-Keesing, author of The Cloud Walkabout.

aws-natgw's People

Contributors

maishsk avatar

Watchers

 avatar  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.