updating CF templates
This commit is contained in:
@@ -1,13 +1,46 @@
|
||||
AWSTemplateFormatVersion: 2010-09-09
|
||||
Description: RDS and settings for ELB strapi deployment.
|
||||
Metadata:
|
||||
|
||||
Description: This template creates an RDS database for an ELB environment.
|
||||
In addition to the database it creates a subnet group for the RDS database,
|
||||
a security group with Ingress rules only allowing connections to the database.
|
||||
It uses an existing Public VPC and subnet already created in
|
||||
another Cloudformation stack. This is public so the database can go out
|
||||
to the internet.
|
||||
Parameters:
|
||||
|
||||
Mappings:
|
||||
|
||||
Conditions:
|
||||
|
||||
StackName:
|
||||
Description: The stack name of another CloudFormation template. This is used
|
||||
to prepend the name of other resources in other templates.
|
||||
Type: String
|
||||
Resources:
|
||||
|
||||
Outputs:
|
||||
VPCSecurityGroupIngress:
|
||||
Type: AWS::EC2::SecurityGroupIngress
|
||||
Properties:
|
||||
GroupId:
|
||||
Fn::ImportValue: !Sub "${StackName}-PublicVPCIDDefaultSecurityGroup"
|
||||
IpProtocol: tcp
|
||||
FromPort: 5432
|
||||
ToPort: 5432
|
||||
CidrIp: 0.0.0.0/0
|
||||
RDSSubnetGroup:
|
||||
Type: AWS::RDS::DBSubnetGroup
|
||||
Properties:
|
||||
DBSubnetGroupDescription: A subnet group for the RDS instance.
|
||||
SubnetIds:
|
||||
- Fn::ImportValue: !Sub "${StackName}-PublicSubnet0"
|
||||
- Fn::ImportValue: !Sub "${StackName}-PublicSubnet1"
|
||||
- Fn::ImportValue: !Sub "${StackName}-PublicSubnet2"
|
||||
rdsDBInstance:
|
||||
Type: AWS::RDS::DBInstance
|
||||
Properties:
|
||||
AllocatedStorage: 5
|
||||
AllowMajorVersionUpgrade: false
|
||||
AutoMinorVersionUpgrade: true
|
||||
DBInstanceClass: "db.t2.micro"
|
||||
DBName: postgres
|
||||
Engine: postgres
|
||||
EngineVersion: 12.2
|
||||
MasterUsername: mainuser
|
||||
MasterUserPassword: password
|
||||
PubliclyAccessible: true
|
||||
VPCSecurityGroups:
|
||||
- Fn::ImportValue: !Sub "${StackName}-PublicVPCIDDefaultSecurityGroup"
|
||||
DBSubnetGroupName: !Ref RDSSubnetGroup
|
||||
|
||||
Reference in New Issue
Block a user