ansible_aws_vpc

Provision AWS VPC, Subnets, Internet and NAT gateways and routes.
git clone git://git.beardyjay.co.uk/ansible_aws_vpc
Log | Files | Refs | README

create_vpc.yml (444B)


      1 ---
      2 - name: create VPC
      3   ec2_vpc_net:
      4     cidr_block: "{{ vpc.cidr_block }}"
      5     name: "{{ vpc_name }}"
      6     region: "{{ aws_region }}"
      7     state: present
      8     tenancy: default
      9   register: my_vpc
     10 
     11 - name: set VPC ID in variable
     12   set_fact:
     13     vpc_id: "{{ my_vpc.vpc.id }}"
     14   when: my_vpc.vpc is defined
     15 
     16 - name: create IGW
     17   ec2_vpc_igw:
     18     region: "{{ aws_region }}"
     19     state: present
     20     vpc_id: "{{ my_vpc.vpc.id }}"
     21   register: created_igw