adding cloudformation templates
This commit is contained in:
93
.cloudformation/02-stack-vpc.yaml
Normal file
93
.cloudformation/02-stack-vpc.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
AWSTemplateFormatVersion: 2010-09-09
|
||||
Description: VPC and Subnet definitions for Strapi + ELB project.
|
||||
Resources:
|
||||
PublicVPC:
|
||||
Type: AWS::EC2::VPC
|
||||
Properties:
|
||||
CidrBlock: "172.31.0.0/16"
|
||||
EnableDnsHostnames: true
|
||||
EnableDnsSupport: true
|
||||
PublicSubnet0:
|
||||
Type: AWS::EC2::Subnet
|
||||
Properties:
|
||||
AvailabilityZone:
|
||||
Fn::Select:
|
||||
- 0
|
||||
- Fn::GetAZs: !Ref "AWS::Region"
|
||||
VpcId: !Ref PublicVPC
|
||||
CidrBlock: 172.31.0.0/20
|
||||
MapPublicIpOnLaunch: true
|
||||
PublicSubnet1:
|
||||
Type: AWS::EC2::Subnet
|
||||
Properties:
|
||||
AvailabilityZone:
|
||||
Fn::Select:
|
||||
- 1
|
||||
- Fn::GetAZs: !Ref "AWS::Region"
|
||||
VpcId: !Ref PublicVPC
|
||||
CidrBlock: 172.31.16.0/20
|
||||
MapPublicIpOnLaunch: true
|
||||
PublicSubnet2:
|
||||
Type: AWS::EC2::Subnet
|
||||
Properties:
|
||||
AvailabilityZone:
|
||||
Fn::Select:
|
||||
- 2
|
||||
- Fn::GetAZs: !Ref "AWS::Region"
|
||||
VpcId: !Ref PublicVPC
|
||||
CidrBlock: 172.31.32.0/20
|
||||
MapPublicIpOnLaunch: true
|
||||
InternetGateway:
|
||||
Type: AWS::EC2::InternetGateway
|
||||
InternetGatewayAttachment:
|
||||
Type: AWS::EC2::VPCGatewayAttachment
|
||||
Properties:
|
||||
VpcId: !Ref PublicVPC
|
||||
InternetGatewayId: !Ref InternetGateway
|
||||
PublicRouteTable:
|
||||
Type: AWS::EC2::RouteTable
|
||||
Properties:
|
||||
VpcId: !Ref PublicVPC
|
||||
PublicRoute:
|
||||
Type: AWS::EC2::Route
|
||||
DependsOn: InternetGatewayAttachment
|
||||
Properties:
|
||||
RouteTableId: !Ref PublicRouteTable
|
||||
DestinationCidrBlock: 0.0.0.0/0
|
||||
GatewayId: !Ref InternetGateway
|
||||
PublicSubnet0RouteTableAssociation:
|
||||
Type: AWS::EC2::SubnetRouteTableAssociation
|
||||
Properties:
|
||||
SubnetId: !Ref PublicSubnet0
|
||||
RouteTableId: !Ref PublicRouteTable
|
||||
PublicSubnet1RouteTableAssociation:
|
||||
Type: AWS::EC2::SubnetRouteTableAssociation
|
||||
Properties:
|
||||
SubnetId: !Ref PublicSubnet1
|
||||
RouteTableId: !Ref PublicRouteTable
|
||||
PublicSubnet2RouteTableAssociation:
|
||||
Type: AWS::EC2::SubnetRouteTableAssociation
|
||||
Properties:
|
||||
SubnetId: !Ref PublicSubnet2
|
||||
RouteTableId: !Ref PublicRouteTable
|
||||
Outputs:
|
||||
PublicVPCID:
|
||||
Description: The VPC ID.
|
||||
Value: !Ref PublicVPC
|
||||
Export:
|
||||
Name: ELBStrapiPublicVPC
|
||||
PublicSubnet0ID:
|
||||
Description: The ID of the subnet.
|
||||
Value: !Ref PublicSubnet0
|
||||
Export:
|
||||
Name: ELBStrapiSubnet0
|
||||
PublicSubnet1ID:
|
||||
Description: The ID of the subnet.
|
||||
Value: !Ref PublicSubnet1
|
||||
Export:
|
||||
Name: ELBStrapiSubnet1
|
||||
PublicSubnet2ID:
|
||||
Description: The ID of the subnet.
|
||||
Value: !Ref PublicSubnet2
|
||||
Export:
|
||||
Name: ELBStrapiSubnet2
|
||||
13
.cloudformation/03-stack-rdsinstance.yaml
Normal file
13
.cloudformation/03-stack-rdsinstance.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
AWSTemplateFormatVersion: 2010-09-09
|
||||
Description: RDS and settings for ELB strapi deployment.
|
||||
Metadata:
|
||||
|
||||
Parameters:
|
||||
|
||||
Mappings:
|
||||
|
||||
Conditions:
|
||||
|
||||
Resources:
|
||||
|
||||
Outputs:
|
||||
Reference in New Issue
Block a user