Skip to content

Instantly share code, notes, and snippets.

@AndrewBestbier
Created March 5, 2020 14:18
Show Gist options
  • Save AndrewBestbier/5ae92480736121d8f244ee1cb7e59c0d to your computer and use it in GitHub Desktop.
Save AndrewBestbier/5ae92480736121d8f244ee1cb7e59c0d to your computer and use it in GitHub Desktop.
Database:
Type: AWS::RDS::DBInstance # (1)
Properties:
VPCSecurityGroups:
- !Ref DbSecurityGroup # (2)
AllocatedStorage: "10"
DBSubnetGroupName: !Ref DbSubnetGroup # (3)
DBInstanceClass: "db.t2.micro"
Engine: "postgres"
MasterUsername: Username
MasterUserPassword: Password
MultiAZ: true # (4)
DbSubnetGroup:
Type: "AWS::RDS::DBSubnetGroup" # (5)
Properties:
DBSubnetGroupDescription: DBSubnetGroup
SubnetIds: # (6)
- !Ref PrivateSubnetA
- !Ref PrivateSubnetB
DbSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Database
VpcId: !Ref VPC
SecurityGroupIngress:
- FromPort: -1
IpProtocol: -1
ToPort: -1
SourceSecurityGroupId: !Ref InstanceSecurityGroup # (7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment