Skip to content

Instantly share code, notes, and snippets.

@Twinuma
Created October 8, 2015 08:43
Show Gist options
  • Save Twinuma/d3e28c3309044f8d3d89 to your computer and use it in GitHub Desktop.
Save Twinuma/d3e28c3309044f8d3d89 to your computer and use it in GitHub Desktop.
オレオレVPC構築テンプレート
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"vpc80ef6be5": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "10.0.0.0/16",
"InstanceTenancy": "default",
"EnableDnsSupport": "true",
"EnableDnsHostnames": "false",
"Tags": [
{
"Key": "Name",
"Value": "demo-vpc"
}
]
}
},
"subnetc973efbe": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.2.0/24",
"AvailabilityZone": "ap-northeast-1a",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "demo-frontend-1a"
}
]
}
},
"subnetcd7ccb94": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.1.0/24",
"AvailabilityZone": "ap-northeast-1c",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "demo-dmz-1c"
}
]
}
},
"subnetbc73efcb": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.4.0/24",
"AvailabilityZone": "ap-northeast-1a",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "demo-backend-1a"
}
]
}
},
"subnetdb73efac": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.0.0/24",
"AvailabilityZone": "ap-northeast-1a",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "demo-dmz-1a"
}
]
}
},
"subnetee7ccbb7": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.5.0/24",
"AvailabilityZone": "ap-northeast-1c",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "demo-backend-1c"
}
]
}
},
"subnetfc7ccba5": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.3.0/24",
"AvailabilityZone": "ap-northeast-1c",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "demo-frontend-1c"
}
]
}
},
"igwd77ea8b2": {
"Type": "AWS::EC2::InternetGateway",
"Properties": {
"Tags": [
{
"Key": "Name",
"Value": "demo-stand-ig"
}
]
}
},
"dopt7df41d18": {
"Type": "AWS::EC2::DHCPOptions",
"Properties": {
"DomainName": "ap-northeast-1.compute.internal",
"DomainNameServers": [
"AmazonProvidedDNS"
]
}
},
"aclfe8c189b": {
"Type": "AWS::EC2::NetworkAcl",
"Properties": {
"VpcId": {
"Ref": "vpc80ef6be5"
}
}
},
"rtb7538a910": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "vpc80ef6be5"
}
}
},
"rtb3938a95c": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "demo-route-coustom"
}
]
}
},
"sgwebsg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "web server security group",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "web-sg"
}
]
}
},
"sgnatsg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "nat security group",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "nat-sg"
}
]
}
},
"sgproxysg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "proxy security group",
"VpcId": "vpc-fd3d8598",
"Tags": [
{
"Key": "Name",
"Value": "proxy-sg"
}
]
}
},
"sgjobelbsg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "job elb security group",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "job-elb-sg"
}
]
}
},
"sgdefault": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "default VPC security group",
"VpcId": {
"Ref": "vpc80ef6be5"
}
}
},
"sgjobsg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "job security group",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "job-sg"
}
]
}
},
"sgelbsg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "elb security group",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "elb-sg"
}
]
}
},
"sgsshonlysg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "ssh only security group",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "ssh-only-sg"
}
]
}
},
"sgdbsg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "db security group",
"VpcId": {
"Ref": "vpc80ef6be5"
},
"Tags": [
{
"Key": "Name",
"Value": "db-sg"
}
]
}
},
"acl1": {
"Type": "AWS::EC2::NetworkAclEntry",
"Properties": {
"CidrBlock": "0.0.0.0/0",
"Egress": "true",
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": "100",
"NetworkAclId": {
"Ref": "aclfe8c189b"
}
}
},
"acl2": {
"Type": "AWS::EC2::NetworkAclEntry",
"Properties": {
"CidrBlock": "0.0.0.0/0",
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": "100",
"NetworkAclId": {
"Ref": "aclfe8c189b"
}
}
},
"subnetacl1": {
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
"Properties": {
"NetworkAclId": {
"Ref": "aclfe8c189b"
},
"SubnetId": {
"Ref": "subnetfc7ccba5"
}
}
},
"subnetacl2": {
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
"Properties": {
"NetworkAclId": {
"Ref": "aclfe8c189b"
},
"SubnetId": {
"Ref": "subnetbc73efcb"
}
}
},
"subnetacl3": {
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
"Properties": {
"NetworkAclId": {
"Ref": "aclfe8c189b"
},
"SubnetId": {
"Ref": "subnetdb73efac"
}
}
},
"subnetacl4": {
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
"Properties": {
"NetworkAclId": {
"Ref": "aclfe8c189b"
},
"SubnetId": {
"Ref": "subnetcd7ccb94"
}
}
},
"subnetacl5": {
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
"Properties": {
"NetworkAclId": {
"Ref": "aclfe8c189b"
},
"SubnetId": {
"Ref": "subnetee7ccbb7"
}
}
},
"subnetacl6": {
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
"Properties": {
"NetworkAclId": {
"Ref": "aclfe8c189b"
},
"SubnetId": {
"Ref": "subnetc973efbe"
}
}
},
"gw1": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": {
"Ref": "vpc80ef6be5"
},
"InternetGatewayId": {
"Ref": "igwd77ea8b2"
}
}
},
"subnetroute2": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "rtb3938a95c"
},
"SubnetId": {
"Ref": "subnetdb73efac"
}
}
},
"subnetroute3": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "rtb3938a95c"
},
"SubnetId": {
"Ref": "subnetcd7ccb94"
}
}
},
"route1": {
"Type": "AWS::EC2::Route",
"Properties": {
"DestinationCidrBlock": "0.0.0.0/0",
"RouteTableId": {
"Ref": "rtb3938a95c"
},
"GatewayId": {
"Ref": "igwd77ea8b2"
}
},
"DependsOn": "gw1"
},
"dchpassoc1": {
"Type": "AWS::EC2::VPCDHCPOptionsAssociation",
"Properties": {
"VpcId": {
"Ref": "vpc80ef6be5"
},
"DhcpOptionsId": {
"Ref": "dopt7df41d18"
}
}
},
"ingress1": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupId": {
"Ref": "sgproxysg"
},
"IpProtocol": "tcp",
"FromPort": "3128",
"ToPort": "3128",
"CidrIp": "0.0.0.0/0"
}
},
"ingress2": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupId": {
"Ref": "sgproxysg"
},
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "157.14.254.52/32"
}
},
"egress1": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgwebsg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress2": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgnatsg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress3": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgproxysg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress4": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgjobelbsg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress5": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgdefault"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress6": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgdefault"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress7": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgjobsg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress8": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgelbsg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress9": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgsshonlysg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"egress10": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "sgdbsg"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
}
},
"Description": "",
"Outputs": {
"sgdefaultName": {
"Value": {
"Ref": "sgdefault"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment