Advertisement
Guest User

Untitled

a guest
Dec 27th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. AWSTemplateFormatVersion: 2010-09-09
  2. Description: >-
  3. AWS CloudFormation Sample Template: This template demonstrates
  4. the creation of a DynamoDB cluster with application AutoScaling. **WARNING** This template creates an numerous resources. You will be billed for the AWS resources used if you create a stack from this template."
  5. Parameters:
  6. username:
  7. Type: String
  8. password:
  9. Type: String
  10. Role:
  11. Type: String
  12. Description: An IAM role arn that allows the CFN template to modify resources on your behalf
  13. ScalePolicyName:
  14. Type: String
  15. Default: ScaleMyRide
  16. Resources:
  17. RDSCluster:
  18. Type: AWS::RDS::DBCluster
  19. Properties:
  20. MasterUsername:
  21. Ref: username
  22. MasterUserPassword:
  23. Ref: password
  24. Engine: aurora
  25. DBClusterParameterGroupName:
  26. Ref: RDSDBClusterParameterGroup
  27. RDSDBInstance1:
  28. Type: AWS::RDS::DBInstance
  29. Properties:
  30. DBParameterGroupName:
  31. Ref: RDSDBParameterGroup
  32. Engine: aurora
  33. DBClusterIdentifier:
  34. Ref: RDSCluster
  35. PubliclyAccessible: 'true'
  36. DBInstanceClass: db.t2.small
  37. RDSDBInstance2:
  38. Type: AWS::RDS::DBInstance
  39. Properties:
  40. DBParameterGroupName:
  41. Ref: RDSDBParameterGroup
  42. Engine: aurora
  43. DBClusterIdentifier:
  44. Ref: RDSCluster
  45. PubliclyAccessible: 'true'
  46. DBInstanceClass: db.t2.small
  47. RDSDBClusterParameterGroup:
  48. Type: AWS::RDS::DBClusterParameterGroup
  49. Properties:
  50. Description: CloudFormation Sample Aurora Cluster Parameter Group
  51. Family: aurora5.6
  52. Parameters:
  53. time_zone: US/Eastern
  54. RDSDBParameterGroup:
  55. Type: AWS::RDS::DBParameterGroup
  56. Properties:
  57. Description: CloudFormation Sample Aurora Parameter Group
  58. Family: aurora5.6
  59. Parameters:
  60. sql_mode: IGNORE_SPACE
  61. ClusterAutoScaleTarget:
  62. Type: AWS::ApplicationAutoScaling::ScalableTarget
  63. Properties:
  64. MaxCapacity: 4
  65. MinCapacity: 1
  66. ResourceId:
  67. !Join
  68. - ''
  69. - - 'cluster:'
  70. - !Ref RDSCluster
  71. RoleARN: !Ref Role
  72. ScalableDimension: rds:cluster:ReadReplicaCount
  73. ServiceNamespace: rds
  74. ClusterAutoScalePolicy:
  75. DependsOn: ClusterAutoScaleTarget
  76. Type: "AWS::ApplicationAutoScaling::ScalingPolicy"
  77. Properties:
  78. PolicyName: !Ref ScalePolicyName
  79. PolicyType: StepScaling
  80. ResourceId:
  81. !Join
  82. - ''
  83. - - 'cluster:'
  84. - !Ref RDSCluster
  85. ScalableDimension: rds:cluster:ReadReplicaCount
  86. ServiceNamespace: rds
  87. StepScalingPolicyConfiguration:
  88. AdjustmentType: ChangeInCapacity
  89. Cooldown: 60
  90. StepAdjustments:
  91. - ScalingAdjustment: 1
  92. MetricIntervalLowerBound: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement