Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. ---
  2. AWSTemplateFormatVersion: 2010-09-09
  3. Description: A basic CloudFormation template for an RDS Aurora cluster.
  4. Parameters:
  5. DatabaseInstanceType:
  6. Default: db.r3.large
  7. AllowedValues:
  8. - db.r3.large
  9. - db.r3.xlarge
  10. - db.r3.2xlarge
  11. - db.r3.4xlarge
  12. - db.r3.8xlarge
  13. Description: The instance type to use for the database.
  14. Type: String
  15. DatabasePassword:
  16. AllowedPattern: "[a-zA-Z0-9]+"
  17. ConstraintDescription: must contain only alphanumeric characters.
  18. Description: The database admin account password.
  19. MaxLength: '41'
  20. MinLength: '8'
  21. NoEcho: 'true'
  22. Type: String
  23. DatabaseUsername:
  24. AllowedPattern: "[a-zA-Z0-9]+"
  25. ConstraintDescription: must contain only alphanumeric characters.
  26. Description: The database admin account user name.
  27. MaxLength: '16'
  28. MinLength: '1'
  29. Type: String
  30. DatabaseBackupRetentionPeriod:
  31. Type: String
  32. Default: 7
  33. AllowedValues:
  34. - 1
  35. - 7
  36. Description: The database backup retention period in days.
  37. DatabaseSubnets:
  38. Description: The subnets to place database instances in.
  39. Type: List<AWS::EC2::Subnet::Id>
  40. DatabaseSecurityGroups:
  41. Type: List<AWS::EC2::SecurityGroup::Id>
  42. Description: Security groups to apply to the RDS cluster.
  43. Metadata:
  44. AWS::CloudFormation::Interface:
  45. ParameterGroups:
  46. - Label:
  47. default: Database Configuration
  48. Parameters:
  49. - DatabaseInstanceType
  50. - DatabaseName
  51. - DatabaseUsername
  52. - DatabasePassword
  53. - DatabaseSubnets
  54. - DatabaseSecurityGroups
  55. - DatabaseBackupRetentionPeriod
  56. ParameterLabels:
  57. DatabaseInstanceType:
  58. default: Database Instance Type
  59. DatabasePassword:
  60. default: Database Password
  61. DatabaseUsername:
  62. default: Database Username
  63. DatabaseBackupRetentionPeriod:
  64. default: Database Backup Retention Period
  65. DatabaseSubnets:
  66. default: Database Subnets
  67. DatabaseSecurityGroups:
  68. default: Database Security Groups
  69. Resources:
  70. DatabaseSubnetGroup:
  71. Type: AWS::RDS::DBSubnetGroup
  72. Properties:
  73. DBSubnetGroupDescription: CloudFormation managed DB subnet group.
  74. SubnetIds:
  75. Ref: DatabaseSubnets
  76. DatabaseCluster:
  77. Type: AWS::RDS::DBCluster
  78. Properties:
  79. Engine: aurora
  80. MasterUsername:
  81. Ref: DatabaseUsername
  82. MasterUserPassword:
  83. Ref: DatabasePassword
  84. BackupRetentionPeriod:
  85. Ref: DatabaseBackupRetentionPeriod
  86. PreferredBackupWindow: 02:00-03:00
  87. PreferredMaintenanceWindow: mon:03:00-mon:04:00
  88. DBSubnetGroupName:
  89. Ref: DatabaseSubnetGroup
  90. VpcSecurityGroupIds:
  91. Ref: DatabaseSecurityGroups
  92. DatabasePrimaryInstance:
  93. Type: AWS::RDS::DBInstance
  94. Properties:
  95. Engine: aurora
  96. DBClusterIdentifier:
  97. Ref: DatabaseCluster
  98. DBInstanceClass:
  99. Ref: DatabaseInstanceType
  100. DBSubnetGroupName:
  101. Ref: DatabaseSubnetGroup
  102. DatabaseReplicaInstance:
  103. Type: AWS::RDS::DBInstance
  104. Properties:
  105. Engine: aurora
  106. DBClusterIdentifier:
  107. Ref: DatabaseCluster
  108. DBInstanceClass:
  109. Ref: DatabaseInstanceType
  110. DBSubnetGroupName:
  111. Ref: DatabaseSubnetGroup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement