Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "AWSTemplateFormatVersion":"2010-09-09",
- "Parameters":{
- "PrivateSubnet1":{
- "Type":"String"
- },
- "PrivateSubnet2":{
- "Type":"String"
- },
- "VPCId":{
- "Type":"String"
- }
- },
- "Resources":{
- "DB":{
- "Type":"AWS::RDS::DBInstance",
- "Properties":{
- "DBName":"TestDB",
- "Engine":"mysql",
- "EngineVersion":"5.7.21",
- "DBInstanceClass":"db.t1.micro",
- "DBInstanceIdentifier":"testdb",
- "MasterUsername":"root",
- "MasterUserPassword":"test#west#345",
- "AllocatedStorage":"100",
- "Iops":"1000",
- "BackupRetentionPeriod":"7",
- "DBSubnetGroupName":{
- "Ref":"DBSubnetGroup"
- },
- "MultiAZ":false,
- "PubliclyAccessible":false,
- "AutoMinorVersionUpgrade":false,
- "VPCSecurityGroups":[
- {
- "Ref":"SecurityGroup"
- }
- ]
- }
- },
- "DBSubnetGroup":{
- "Type":"AWS::RDS::DBSubnetGroup",
- "Properties":{
- "DBSubnetGroupDescription":"DB subnet group description",
- "SubnetIds":[
- {
- "Ref":"PrivateSubnet1"
- },
- {
- "Ref":"PrivateSubnet2"
- }
- ]
- }
- },
- "DBSecurityGroup":{
- "Type":"AWS::RDS::DBSecurityGroup",
- "Properties":{
- "EC2VpcId":{
- "Ref":"VPCId"
- },
- "DBSecurityGroupIngress":{
- "EC2SecurityGroupName":{
- "Ref":"SecurityGroup"
- }
- },
- "GroupDescription":"Database Access"
- }
- },
- "SecurityGroup":{
- "Type":"AWS::EC2::SecurityGroup",
- "Properties":{
- "VpcId":{
- "Ref":"VPCId"
- },
- "GroupDescription":"Enable database access for application",
- "SecurityGroupIngress":[
- {
- "IpProtocol":"tcp",
- "FromPort":"3306",
- "ToPort":"3306",
- "CidrIp":"0.0.0.0/0"
- }
- ]
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment