Last active
August 29, 2015 14:23
-
-
Save suz-lab/7d8774bf97a60057f09a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"ProjectName": { | |
"Type": "String", | |
"Default": "suzlab" | |
}, | |
"VpcId": { | |
"Type": "AWS::EC2::VPC::Id", | |
"Default": "vpc-aaaaaaaa" | |
}, | |
"Az1SubnetId": { | |
"Type": "AWS::EC2::Subnet::Id", | |
"Default": "subnet-bbbbbbbb" | |
}, | |
"Az2SubnetId": { | |
"Type": "AWS::EC2::Subnet::Id", | |
"Default": "subnet-cccccccc" | |
}, | |
"VpcSecurityGroup": { | |
"Type": "AWS::EC2::SecurityGroup::Id", | |
"Default": "sg-dddddddd" | |
} | |
}, | |
"Resources": { | |
"DbSubnetGroup": { | |
"Type": "AWS::RDS::DBSubnetGroup", | |
"Properties": { | |
"DBSubnetGroupDescription": { "Ref": "ProjectName" }, | |
"SubnetIds": [ | |
{ "Ref": "Az1SubnetId" }, | |
{ "Ref": "Az2SubnetId" } | |
] | |
} | |
}, | |
"DbInstance": { | |
"Type": "AWS::RDS::DBInstance", | |
"Properties": { | |
"Engine": "MySQL", | |
"DBSubnetGroupName": { "Ref": "DbSubnetGroup" }, | |
"AllocatedStorage": "5", | |
"DBInstanceClass": "db.t2.micro", | |
"DBInstanceIdentifier": { "Ref": "ProjectName" }, | |
"MasterUsername": { "Ref": "ProjectName" }, | |
"MasterUserPassword": { "Fn::Join" : [ "", [ | |
{ "Ref": "ProjectName" }, | |
"!Z3" | |
] ] }, | |
"VPCSecurityGroups": [ { "Ref": "VpcSecurityGroup"} ] | |
} | |
}, | |
"HostedZone": { | |
"Type": "AWS::Route53::HostedZone", | |
"Properties": { | |
"Name": { "Fn::Join" : [ "", [ | |
{ "Ref": "ProjectName" }, | |
".local" | |
] ] }, | |
"VPCs": [ { | |
"VPCId": { "Ref": "VpcId" }, | |
"VPCRegion": { "Ref": "AWS::Region" } | |
} ] | |
} | |
}, | |
"RdsRecordSet": { | |
"Type": "AWS::Route53::RecordSet", | |
"Properties": { | |
"HostedZoneId": { "Ref": "HostedZone" }, | |
"Name": { "Fn::Join" : [ "", [ | |
"rds.", | |
{ "Ref": "ProjectName" }, | |
".local." | |
] ] }, | |
"Type": "CNAME", | |
"TTL": "60", | |
"ResourceRecords": [ | |
{ "Fn::GetAtt": [ "DbInstance", "Endpoint.Address" ] } | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment