Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (107 sloc) 3.51 KB
AWSTemplateFormatVersion: "2010-09-09"
Description:
"Network settings for docker_rec_radiko with Fargate"
Parameters:
ProjectName:
Type: String
Default: "docker_rec_radiko_with_fargate"
VpcCIDR:
Type: String
Default: "10.0.0.0/16"
SubnetCIDRClock:
Type: String
Default: "10.0.0.0/24"
VpcName:
Type: String
Default: "Vpc"
SubnetName:
Type: String
Default: "Subnet"
SecurityGroupGroupName:
Type: String
Default: "SecurityGroup"
SecurityGroupName:
Type: String
Default: "SecurityGroup"
RouteTableName:
Type: String
Default: "rt"
RouteDestinationCIDRBlock:
Type: String
Default: "0.0.0.0/0"
Resources:
Vpc:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCIDR
EnableDnsSupport: true
EnableDnsHostnames: true
InstanceTenancy: default
Tags:
- Key: Name
Value: !Sub "${ProjectName}-${VpcName}"
Subnet:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html
Type: AWS::EC2::Subnet
Properties:
AvailabilityZone: !Select
- 0
- Fn::GetAZs: !Ref "AWS::Region"
CidrBlock: !Ref SubnetCIDRClock
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: !Sub "${ProjectName}-${SubnetName}"
VpcId: !Ref Vpc
SSMSubnet:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-parameter.html
Type: AWS::SSM::Parameter
Properties:
Name: !Sub "/${ProjectName}/SSMSubnet"
Type: String
Value: !Ref Subnet
SecurityGroup:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: !Sub "${ProjectName}-${SecurityGroupGroupName}"
GroupDescription: !Sub "SecurityGroup for ${ProjectName}"
VpcId: !Ref Vpc
SSMSecurityGroup:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-parameter.html
Type: AWS::SSM::Parameter
Properties:
Name: !Sub "/${ProjectName}/SSMSecurityGroup"
Type: String
Value: !Ref SecurityGroup
Gateway:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-internetgateway.html
Type: AWS::EC2::InternetGateway
VPCGatewayAttachment:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc-gateway-attachment.html
Type: AWS::EC2::VPCGatewayAttachment
Properties:
InternetGatewayId: !Ref Gateway
VpcId: !Ref Vpc
RouteTable:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-route-table.html
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref Vpc
Tags:
- Key: Name
Value: !Sub "${ProjectName}-${RouteTableName}"
Route:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-route.html
Type: AWS::EC2::Route
Properties:
DestinationCidrBlock: !Ref RouteDestinationCIDRBlock
GatewayId: !Ref Gateway
RouteTableId: !Ref RouteTable
SubnetRouteTableAssociation:
# https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet-route-table-assoc.html
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref RouteTable
SubnetId: !Ref Subnet
You can’t perform that action at this time.