Skip to content

Instantly share code, notes, and snippets.

@hacker65536
Last active August 29, 2015 14:16
Show Gist options
  • Save hacker65536/16f2ce4ff64df28ed48d to your computer and use it in GitHub Desktop.
Save hacker65536/16f2ce4ff64df28ed48d to your computer and use it in GitHub Desktop.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Conditions": {},
"Description": "template",
"Mappings": {},
"Outputs": {},
"Parameters": {
"TagName": {
"Default": "tagname",
"Description": "env tag",
"Type": "String"
},
"VPCCidr": {
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})",
"ConstraintDescription": "input first two octets of an IP range",
"Default": "10.1",
"Description": "VPC Cidr X.X.0.0/16",
"Type": "String"
}
},
"Resources": {
"Subnet0": {
"Properties": {
"AvailabilityZone": {
"Fn::Select": [
"0",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
},
"CidrBlock": {
"Fn::Join": [
"",
[
{
"Ref": "VPCCidr"
},
".0.0/24"
]
]
},
"Tags": [
{
"Key": "Name",
"Value": {
"Fn::Join": [
"-",
[
{
"Ref": "AWS::StackName"
},
"subnet0"
]
]
}
}
],
"VpcId": {
"Ref": "VPC"
}
},
"Type": "AWS::EC2::Subnet"
},
"Subnet1": {
"Properties": {
"AvailabilityZone": {
"Fn::Select": [
"1",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
},
"CidrBlock": {
"Fn::Join": [
"",
[
{
"Ref": "VPCCidr"
},
".1.0/24"
]
]
},
"Tags": [
{
"Key": "Name",
"Value": {
"Fn::Join": [
"-",
[
{
"Ref": "AWS::StackName"
},
"subnet1"
]
]
}
}
],
"VpcId": {
"Ref": "VPC"
}
},
"Type": "AWS::EC2::Subnet"
},
"SubnetRouteTableAssoc0": {
"Properties": {
"RouteTableId": {
"Ref": "VPCRouteTable0"
},
"SubnetId": {
"Ref": "Subnet0"
}
},
"Type": "AWS::EC2::SubnetRouteTableAssociation"
},
"SubnetRouteTableAssoc1": {
"Properties": {
"RouteTableId": {
"Ref": "VPCRouteTable0"
},
"SubnetId": {
"Ref": "Subnet1"
}
},
"Type": "AWS::EC2::SubnetRouteTableAssociation"
},
"VPC": {
"Properties": {
"CidrBlock": {
"Fn::Join": [
"",
[
{
"Ref": "VPCCidr"
},
".0.0/16"
]
]
},
"EnableDnsHostnames": true,
"EnableDnsSupport": true,
"Tags": [
{
"Key": "Name",
"Value": {
"Ref": "AWS::StackName"
}
}
]
},
"Type": "AWS::EC2::VPC"
},
"VPCIGW": {
"Properties": {
"Tags": [
{
"Key": "Name",
"Value": {
"Fn::Join": [
"-",
[
{
"Ref": "AWS::StackName"
},
"IGW"
]
]
}
}
]
},
"Type": "AWS::EC2::InternetGateway"
},
"VPCIGWAttach": {
"Properties": {
"InternetGatewayId": {
"Ref": "VPCIGW"
},
"VpcId": {
"Ref": "VPC"
}
},
"Type": "AWS::EC2::VPCGatewayAttachment"
},
"VPCRoute0": {
"Properties": {
"DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": {
"Ref": "VPCIGW"
},
"RouteTableId": {
"Ref": "VPCRouteTable0"
}
},
"Type": "AWS::EC2::Route"
},
"VPCRouteTable0": {
"Properties": {
"Tags": [
{
"Key": "Name",
"Value": {
"Fn::Join": [
"-",
[
{
"Ref": "AWS::StackName"
},
"IGWRoute"
]
]
}
}
],
"VpcId": {
"Ref": "VPC"
}
},
"Type": "AWS::EC2::RouteTable"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment