aws-vpc-igw

Ansible role: AWS VPC IGW

This role is able to create any number of Internet Gateways, each attached to a VPC in AWS.

Build Status Version Ansible Galaxy

Requirements

  • Ansible 2.5

Additional variables

Additional variables that can be used (either as host_vars/group_vars or via command line args):

Variable Description
aws_vpc_igw_profile Boto profile name to be used
aws_vpc_igw_default_region Default region to use
aws_vpc_igw_vpc_filter_additional Additional key val filter to add to vpc_filter and vpc_name by default.

Example definition

IGW's can be created per VPC either by supplying a VPC name or a VPC filter.

Required parameter only

aws_vpc_igws:
  # Create IGW for a VPC by VPC name
  - name: my-igw-1
    vpc_name: devops-test-vpc
  # Create IGW for a VPC by VPC filter
  - name: my-igw-2
    vpc_filter:
      - key: "tag:Name"
        val: "devops-test-vpc"
      - key: "tag:env"
        val: playground
      - key: "tag:department"
        val: devops

All available parameter

# Ensure VPC filter (name or filter) includes that the VPC is created already
# (not pending nor deleted)
aws_vpc_igw_vpc_filter_additional:
  - key: state
    val: available

aws_vpc_igws:
  # Create IGW for a VPC by VPC name
  - name: my-igw-1
    vpc_name: devops-test-vpc
    region: eu-central-1
    tags:
      - key: env
        val: playground
      - key: department
        val: devops
  # Create IGW for a VPC by VPC filter
  - name: my-igw-2
    vpc_filter:
      - key: "tag:Name"
        val: "devops-test-vpc"
      - key: "tag:env"
        val: playground
      - key: "tag:department"
        val: devops
    region: eu-central-1
    tags:
      - key: env
        val: playground
      - key: department
        val: devops

Testing

Requirements

Run tests

# Lint the source files
make lint

# Run integration tests with default Ansible version
make test

# Run integration tests with custom Ansible version
make test ANSIBLE_VERSION=2.4
About

Creates an arbitrary number of IGW's for any VPC on AWS

Install
ansible-galaxy install Flaconi/ansible-role-aws-vpc-igw
GitHub repository
License
apache-2.0
Downloads
43