Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save suz-lab/8ea31ddad7058a3cbc91 to your computer and use it in GitHub Desktop.
Save suz-lab/8ea31ddad7058a3cbc91 to your computer and use it in GitHub Desktop.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"VpcCidrBlock": {
"Type": "String",
"Default": "10.0.0.0/16"
}
},
"Resources": {
"Vpc": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": { "Ref": "VpcCidrBlock" },
"EnableDnsSupport": "true",
"EnableDnsHostnames": "true",
"InstanceTenancy": "default",
"Tags": [ {
"Key": "Name",
"Value": "Packer"
} ]
}
},
"InternetGateway": {
"Type": "AWS::EC2::InternetGateway",
"Properties": {
"Tags": [ {
"Key": "Name",
"Value": "Packer"
} ]
}
},
"VpcGatewayAttachment": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": { "Ref": "Vpc" },
"InternetGatewayId": { "Ref": "InternetGateway" }
}
},
"RouteTable": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": { "Ref": "Vpc" },
"Tags": [ {
"Key": "Name",
"Value": "Packer"
} ]
}
},
"Route" : {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": { "Ref": "RouteTable" },
"DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": { "Ref": "InternetGateway" }
}
},
"Subnet" : {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": { "Ref": "Vpc" },
"CidrBlock": { "Ref": "VpcCidrBlock" },
"AvailabilityZone": { "Fn::Select": [ "0", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] },
"Tags": [ {
"Key": "Name",
"Value": "Packer"
} ]
}
},
"SubnetRouteTableAssociation": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"SubnetId": { "Ref": "Subnet" },
"RouteTableId": { "Ref": "RouteTable" }
}
}
},
"Outputs": {
"Vpc": {
"Value": { "Ref": "Vpc" }
},
"Subnet": {
"Value": { "Ref": "Subnet" }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment