Skip to content

Instantly share code, notes, and snippets.

@colbygk
Created May 12, 2016 16:17
Show Gist options
  • Save colbygk/d1941f76224c515811df860fb4187385 to your computer and use it in GitHub Desktop.
Save colbygk/d1941f76224c515811df860fb4187385 to your computer and use it in GitHub Desktop.
---
###############################################################################
# Edit the following variables to suit
env: scratch-api-test
region: blah
az_1: blah
key_name: blah
nat_ami: blah
nat_eipalloc_list:
- blah
- blah
nat_instance_type: blah
bastion_ami: blah
bastion_instance_type: blah
###############################################################################
# Be careful editing anything below
vpc:
name: "{{ env }}"
cidr_block: blah
tags:
Environment: "{{ env }}"
subnets:
- cidr: blah
az: "{{ az_1 }}"
resource_tags:
Name: "{{ env + '_public' }}"
Environment: "{{ env }}"
Type: "public"
- cidr: blah
az: "{{ az_1 }}"
resource_tags:
Name: "{{ env + '_private' }}"
Environment: "{{ env }}"
Type: "private"
route_tables:
igw:
- resource_tags:
Name: "{{ env + '_public' }}"
Environment: "{{ env }}"
subnets:
- "10.0.0.0/24"
routes:
- dest: 0.0.0.0/0
gateway_id: igw
private:
- resource_tags:
Name: "{{ env + '_private' }}"
Environment: "{{ env }}"
subnets:
- "{{ env + '_private' }}"
routes:
- dest: 0.0.0.0/0
gateway_id: igw
sg_list:
- name: "{{ env + '_nat' }}"
description: allow outbound nat
rules:
- proto: all
cidr_ip: blah
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: blah
rules_egress:
- proto: all
cidr_ip: 0.0.0.0/0
- name: "{{ env + '_bastion' }}"
description: access bastion, allow outbound nat
rules:
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: blah
- proto: icmp
from_port: -1
to_port: -1
cidr_ip: 0.0.0.0/0
rules_egress:
- proto: all
cidr_ip: 0.0.0.0/0
nat_asg_lc:
name: "{{ env + '_nat_asg_lc' }}"
image_id: "{{ nat_ami }}"
security_group: "{{ env + '_nat' }}"
instance_type: "{{ nat_instance_type }}"
key_name: "{{ key_name }}"
instance_profile_name: "{{ env + 'NATMonitorInstanceAccess' }}"
resource_tags:
Environment: "{{ env }}"
nat_asg:
name: "{{ env + '_nat_asg' }}"
launch_config_name: "{{ env + '_nat_asg_lc' }}"
replace_all_instances: yes
desired_capacity: 2
min_size: 2
max_size: 2
resource_tags:
Environment: "{{ env }}"
availability_zones:
- "{{ az_1 }}"
tags:
- Name: "{{ env + '_nat' }}"
- Environment: "{{ env }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment