Last active
June 27, 2018 03:32
-
-
Save jipengxiang/61ab4cc24077dbff4322baf19e243478 to your computer and use it in GitHub Desktop.
Database mySQL
This file contains 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
"MyDB" : { | |
"Type" : "AWS::RDS::DBInstance", | |
"Properties" : { | |
"DBName" : { "Ref" : "DBName" }, | |
"AllocatedStorage" : { "Ref" : "DBAllocatedStorage" }, | |
"DBInstanceClass" : { "Ref" : "DBInstanceClass" }, | |
"Engine" : "MySQL", | |
"EngineVersion" : "5.5", | |
"MasterUsername" : { "Ref" : "DBUser" }, | |
"MasterUserPassword" : { "Ref" : "DBPassword" }, | |
"Tags" : [ { "Key" : "Name", "Value" : "My SQL Database" } ] | |
}, | |
"DeletionPolicy" : "Snapshot" | |
} |
This file contains 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
"WebServer": { | |
"Type": "AWS::EC2::Instance", | |
"Metadata" : { | |
"AWS::CloudFormation::Init" : { | |
"config" : { | |
"packages" : { | |
"yum" : { | |
"java-1.6.0-openjdk" : [], | |
"tomcat6" : [], | |
"httpd" : [] | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the CreateLargeSize condition is true, AWS CloudFormation sets the volume size to 100. If the condition is false, AWS CloudFormation sets the volume size to 10.
Example JSON
"NewVolume" : {
"Type" : "AWS::EC2::Volume",
"Properties" : {https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html
"Size" : {
"Fn::If" : [
"CreateLargeSize",
"100",
"10"
]},
"AvailabilityZone" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ]}
},
"DeletionPolicy" : "Snapshot"
}