Skip to content

Instantly share code, notes, and snippets.

@tobstarr
Last active August 29, 2015 13:56
Show Gist options
  • Save tobstarr/9130183 to your computer and use it in GitHub Desktop.
Save tobstarr/9130183 to your computer and use it in GitHub Desktop.
#!/bin/bash
aws cloudformation create-stack --stack-name test-vpc --template-body file://vpc.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Test VPN",
"Resources": {
"route": {
"Type": "AWS::EC2::Route",
"Properties": {
"DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": {
"Ref": "gateway"
},
"RouteTableId": {
"Ref": "routeTable"
}
}
},
"gateway": {
"Type": "AWS::EC2::InternetGateway"
},
"associateSubnetC": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "routeTable"
},
"SubnetId": {
"Ref": "subnetC"
}
}
},
"associateSubnetB": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "routeTable"
},
"SubnetId": {
"Ref": "subnetB"
}
}
},
"associateSubnetA": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "routeTable"
},
"SubnetId": {
"Ref": "subnetA"
}
}
},
"vpcAttachment": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"InternetGatewayId": {
"Ref": "gateway"
},
"VpcId": {
"Ref": "vpc"
}
}
},
"vpc": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "172.31.0.0/16",
"EnableDnsHostnames": true,
"EnableDnsSupport": true,
"InstanceTenancy": "default",
"Tags": [
{
"Key": "Name",
"Value": "FILL_ME_IN"
}
]
}
},
"dhcpOptions": {
"Properties": {
"DomainNameServers": [
"AmazonProvidedDNS"
],
"DomainName": "test.domaon"
},
"Type": "AWS::EC2::DHCPOptions"
},
"vpcDhcOptions": {
"Properties": {
"VpcId": {
"Ref": "vpc"
},
"DhcpOptionsId": {
"Ref": "dhcpOptions"
}
},
"Type": "AWS::EC2::VPCDHCPOptionsAssociation"
},
"subnetC": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"AvailabilityZone": "eu-west-1c",
"CidrBlock": "172.31.0.0/20",
"VpcId": {
"Ref": "vpc"
}
}
},
"subnetB": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"AvailabilityZone": "eu-west-1b",
"CidrBlock": "172.31.32.0/20",
"VpcId": {
"Ref": "vpc"
}
}
},
"subnetA": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"AvailabilityZone": "eu-west-1a",
"CidrBlock": "172.31.16.0/20",
"VpcId": {
"Ref": "vpc"
}
}
},
"routeTable": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "vpc"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment