Skip to content

Instantly share code, notes, and snippets.

@xhiroga
Created October 5, 2019 23:09
Show Gist options
  • Save xhiroga/5d5d33e2a677efce1a82c2f2d7cc9484 to your computer and use it in GitHub Desktop.
Save xhiroga/5d5d33e2a677efce1a82c2f2d7cc9484 to your computer and use it in GitHub Desktop.
AWS CDKで構築したVPCのテンプレート
Resources:
CDKTESTHIROGA2CBE18D7:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: true
EnableDnsSupport: true
InstanceTenancy: default
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/Resource
CDKTESTHIROGAPublicSubnet1SubnetEDE92B34:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: 10.0.0.0/18
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
AvailabilityZone:
Fn::Select:
- 0
- Fn::GetAZs: ""
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PublicSubnet1
- Key: aws-cdk:subnet-name
Value: Public
- Key: aws-cdk:subnet-type
Value: Public
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet1/Subnet
CDKTESTHIROGAPublicSubnet1RouteTableB9BEA170:
Type: AWS::EC2::RouteTable
Properties:
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PublicSubnet1
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet1/RouteTable
CDKTESTHIROGAPublicSubnet1RouteTableAssociation58667BCC:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPublicSubnet1RouteTableB9BEA170
SubnetId:
Ref: CDKTESTHIROGAPublicSubnet1SubnetEDE92B34
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet1/RouteTableAssociation
CDKTESTHIROGAPublicSubnet1DefaultRoute7DB8B05A:
Type: AWS::EC2::Route
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPublicSubnet1RouteTableB9BEA170
DestinationCidrBlock: 0.0.0.0/0
GatewayId:
Ref: CDKTESTHIROGAIGW7198D730
DependsOn:
- CDKTESTHIROGAVPCGWF1B767FC
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet1/DefaultRoute
CDKTESTHIROGAPublicSubnet1EIP144B46E4:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet1/EIP
CDKTESTHIROGAPublicSubnet1NATGateway4BAF94BA:
Type: AWS::EC2::NatGateway
Properties:
AllocationId:
Fn::GetAtt:
- CDKTESTHIROGAPublicSubnet1EIP144B46E4
- AllocationId
SubnetId:
Ref: CDKTESTHIROGAPublicSubnet1SubnetEDE92B34
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PublicSubnet1
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet1/NATGateway
CDKTESTHIROGAPublicSubnet2Subnet6E592E24:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: 10.0.64.0/18
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
AvailabilityZone:
Fn::Select:
- 1
- Fn::GetAZs: ""
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PublicSubnet2
- Key: aws-cdk:subnet-name
Value: Public
- Key: aws-cdk:subnet-type
Value: Public
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet2/Subnet
CDKTESTHIROGAPublicSubnet2RouteTable90C18B09:
Type: AWS::EC2::RouteTable
Properties:
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PublicSubnet2
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet2/RouteTable
CDKTESTHIROGAPublicSubnet2RouteTableAssociationD25DA5EC:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPublicSubnet2RouteTable90C18B09
SubnetId:
Ref: CDKTESTHIROGAPublicSubnet2Subnet6E592E24
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet2/RouteTableAssociation
CDKTESTHIROGAPublicSubnet2DefaultRoute1D8574BF:
Type: AWS::EC2::Route
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPublicSubnet2RouteTable90C18B09
DestinationCidrBlock: 0.0.0.0/0
GatewayId:
Ref: CDKTESTHIROGAIGW7198D730
DependsOn:
- CDKTESTHIROGAVPCGWF1B767FC
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet2/DefaultRoute
CDKTESTHIROGAPublicSubnet2EIP320C5E7E:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet2/EIP
CDKTESTHIROGAPublicSubnet2NATGatewayEA572626:
Type: AWS::EC2::NatGateway
Properties:
AllocationId:
Fn::GetAtt:
- CDKTESTHIROGAPublicSubnet2EIP320C5E7E
- AllocationId
SubnetId:
Ref: CDKTESTHIROGAPublicSubnet2Subnet6E592E24
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PublicSubnet2
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PublicSubnet2/NATGateway
CDKTESTHIROGAPrivateSubnet1SubnetCE38B8BE:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: 10.0.128.0/18
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
AvailabilityZone:
Fn::Select:
- 0
- Fn::GetAZs: ""
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PrivateSubnet1
- Key: aws-cdk:subnet-name
Value: Private
- Key: aws-cdk:subnet-type
Value: Private
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet1/Subnet
CDKTESTHIROGAPrivateSubnet1RouteTableE490D612:
Type: AWS::EC2::RouteTable
Properties:
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PrivateSubnet1
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet1/RouteTable
CDKTESTHIROGAPrivateSubnet1RouteTableAssociation6413FA88:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPrivateSubnet1RouteTableE490D612
SubnetId:
Ref: CDKTESTHIROGAPrivateSubnet1SubnetCE38B8BE
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet1/RouteTableAssociation
CDKTESTHIROGAPrivateSubnet1DefaultRouteE78A81BF:
Type: AWS::EC2::Route
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPrivateSubnet1RouteTableE490D612
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId:
Ref: CDKTESTHIROGAPublicSubnet1NATGateway4BAF94BA
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet1/DefaultRoute
CDKTESTHIROGAPrivateSubnet2Subnet22ADF648:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: 10.0.192.0/18
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
AvailabilityZone:
Fn::Select:
- 1
- Fn::GetAZs: ""
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PrivateSubnet2
- Key: aws-cdk:subnet-name
Value: Private
- Key: aws-cdk:subnet-type
Value: Private
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet2/Subnet
CDKTESTHIROGAPrivateSubnet2RouteTable9970D405:
Type: AWS::EC2::RouteTable
Properties:
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA/PrivateSubnet2
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet2/RouteTable
CDKTESTHIROGAPrivateSubnet2RouteTableAssociation71FEF247:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPrivateSubnet2RouteTable9970D405
SubnetId:
Ref: CDKTESTHIROGAPrivateSubnet2Subnet22ADF648
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet2/RouteTableAssociation
CDKTESTHIROGAPrivateSubnet2DefaultRoute467C5761:
Type: AWS::EC2::Route
Properties:
RouteTableId:
Ref: CDKTESTHIROGAPrivateSubnet2RouteTable9970D405
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId:
Ref: CDKTESTHIROGAPublicSubnet2NATGatewayEA572626
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/PrivateSubnet2/DefaultRoute
CDKTESTHIROGAIGW7198D730:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: cdk/CDK_TEST_HIROGA
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/IGW
CDKTESTHIROGAVPCGWF1B767FC:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId:
Ref: CDKTESTHIROGA2CBE18D7
InternetGatewayId:
Ref: CDKTESTHIROGAIGW7198D730
Metadata:
aws:cdk:path: cdk/CDK_TEST_HIROGA/VPCGW
CDKMetadata:
Type: AWS::CDK::Metadata
Properties:
Modules: aws-cdk=1.11.0,@aws-cdk/aws-cloudwatch=1.11.0,@aws-cdk/aws-ec2=1.11.0,@aws-cdk/aws-iam=1.11.0,@aws-cdk/aws-ssm=1.11.0,@aws-cdk/core=1.11.0,@aws-cdk/cx-api=1.11.0,@aws-cdk/region-info=1.11.0,jsii-runtime=Python/3.7.4
Condition: CDKMetadataAvailable
Conditions:
CDKMetadataAvailable:
Fn::Or:
- Fn::Or:
- Fn::Equals:
- Ref: AWS::Region
- ap-east-1
- Fn::Equals:
- Ref: AWS::Region
- ap-northeast-1
- Fn::Equals:
- Ref: AWS::Region
- ap-northeast-2
- Fn::Equals:
- Ref: AWS::Region
- ap-south-1
- Fn::Equals:
- Ref: AWS::Region
- ap-southeast-1
- Fn::Equals:
- Ref: AWS::Region
- ap-southeast-2
- Fn::Equals:
- Ref: AWS::Region
- ca-central-1
- Fn::Equals:
- Ref: AWS::Region
- cn-north-1
- Fn::Equals:
- Ref: AWS::Region
- cn-northwest-1
- Fn::Equals:
- Ref: AWS::Region
- eu-central-1
- Fn::Or:
- Fn::Equals:
- Ref: AWS::Region
- eu-north-1
- Fn::Equals:
- Ref: AWS::Region
- eu-west-1
- Fn::Equals:
- Ref: AWS::Region
- eu-west-2
- Fn::Equals:
- Ref: AWS::Region
- eu-west-3
- Fn::Equals:
- Ref: AWS::Region
- me-south-1
- Fn::Equals:
- Ref: AWS::Region
- sa-east-1
- Fn::Equals:
- Ref: AWS::Region
- us-east-1
- Fn::Equals:
- Ref: AWS::Region
- us-east-2
- Fn::Equals:
- Ref: AWS::Region
- us-west-1
- Fn::Equals:
- Ref: AWS::Region
- us-west-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment