Skip to content

Instantly share code, notes, and snippets.

@ageekymonk
Created December 20, 2014 06:06
Show Gist options
  • Save ageekymonk/6569e94e095ce3ba5b9b to your computer and use it in GitHub Desktop.
Save ageekymonk/6569e94e095ce3ba5b9b to your computer and use it in GitHub Desktop.
Cloudformation Script to create a VPC with one subnet in aws
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS Template to create a a VPC",
"Resources" : {
"VPC" : {
"Type" : "AWS::EC2::VPC",
"Properties" : {
"CidrBlock" : "10.0.0.0/16",
"Tags" : [ {"Key" : "Application", "Value" : { "Ref" : "AWS::StackId"} } ]
}
},
"Subnet" : {
"Type" : "AWS::EC2::Subnet",
"Properties" : {
"VpcId" : { "Ref" : "VPC" },
"CidrBlock" : "10.0.0.0/24",
"Tags" : [ {"Key" : "Application", "Value" : { "Ref" : "AWS::StackId"} } ]
}
},
"InternetGateway" : {
"Type" : "AWS::EC2::InternetGateway",
"Properties" : {
"Tags" : [ {"Key" : "Application", "Value" : { "Ref" : "AWS::StackId"} } ]
}
},
"AttachGateway" : {
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"VpcId" : { "Ref" : "VPC" },
"InternetGatewayId" : { "Ref" : "InternetGateway" }
}
},
"RouteTable" : {
"Type" : "AWS::EC2::RouteTable",
"Properties" : {
"VpcId" : {"Ref" : "VPC"},
"Tags" : [ {"Key" : "Application", "Value" : { "Ref" : "AWS::StackId"} } ]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment