Skip to content

Instantly share code, notes, and snippets.

@IslandUsurper IslandUsurper/aws.yml
Last active Jun 15, 2016

Embed
What would you like to do?
Setting up VPC subnets
- name: Create VPC
ec2_vpc_net:
cidr_block: 10.0.0.0/16
name: {{ Environment }}
state: present
tenancy: default
register: vpc
- name: Create Internet gateway
ec2_vpc_igw: vpc_id={{ vpc.vpc.id }} state=present
register: igw
- name: Create Private subnets
ec2_vpc_subnet:
az: "{{ item.az }}"
cidr: "{{ item.cidr }}"
tags: "{{ item.tags }}"
vpc_id: "{{ vpc.vpc.id }}"
state: present
with_items: "{{ private_subnets }}"
register: private
- name: Create Public subnets
ec2_vpc_subnet:
az: "{{ item.az }}"
cidr: "{{ item.cidr }}"
tags: "{{ item.tags }}"
vpc_id: "{{ vpc.vpc.id }}"
state: present
with_items: "{{ public_subnets }}"
register: public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.