Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AWSTemplateFormatVersion: 2010-09-09
- Description: >-
- AWS CloudFormation Sample Template: This template demonstrates
- 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."
- Parameters:
- username:
- Type: String
- password:
- Type: String
- Role:
- Type: String
- Description: An IAM role arn that allows the CFN template to modify resources on your behalf
- ScalePolicyName:
- Type: String
- Default: ScaleMyRide
- Resources:
- RDSCluster:
- Type: AWS::RDS::DBCluster
- Properties:
- MasterUsername:
- Ref: username
- MasterUserPassword:
- Ref: password
- Engine: aurora
- DBClusterParameterGroupName:
- Ref: RDSDBClusterParameterGroup
- RDSDBInstance1:
- Type: AWS::RDS::DBInstance
- Properties:
- DBParameterGroupName:
- Ref: RDSDBParameterGroup
- Engine: aurora
- DBClusterIdentifier:
- Ref: RDSCluster
- PubliclyAccessible: 'true'
- DBInstanceClass: db.t2.small
- RDSDBInstance2:
- Type: AWS::RDS::DBInstance
- Properties:
- DBParameterGroupName:
- Ref: RDSDBParameterGroup
- Engine: aurora
- DBClusterIdentifier:
- Ref: RDSCluster
- PubliclyAccessible: 'true'
- DBInstanceClass: db.t2.small
- RDSDBClusterParameterGroup:
- Type: AWS::RDS::DBClusterParameterGroup
- Properties:
- Description: CloudFormation Sample Aurora Cluster Parameter Group
- Family: aurora5.6
- Parameters:
- time_zone: US/Eastern
- RDSDBParameterGroup:
- Type: AWS::RDS::DBParameterGroup
- Properties:
- Description: CloudFormation Sample Aurora Parameter Group
- Family: aurora5.6
- Parameters:
- sql_mode: IGNORE_SPACE
- ClusterAutoScaleTarget:
- Type: AWS::ApplicationAutoScaling::ScalableTarget
- Properties:
- MaxCapacity: 4
- MinCapacity: 1
- ResourceId:
- !Join
- - ''
- - - 'cluster:'
- - !Ref RDSCluster
- RoleARN: !Ref Role
- ScalableDimension: rds:cluster:ReadReplicaCount
- ServiceNamespace: rds
- ClusterAutoScalePolicy:
- DependsOn: ClusterAutoScaleTarget
- Type: "AWS::ApplicationAutoScaling::ScalingPolicy"
- Properties:
- PolicyName: !Ref ScalePolicyName
- PolicyType: StepScaling
- ResourceId:
- !Join
- - ''
- - - 'cluster:'
- - !Ref RDSCluster
- ScalableDimension: rds:cluster:ReadReplicaCount
- ServiceNamespace: rds
- StepScalingPolicyConfiguration:
- AdjustmentType: ChangeInCapacity
- Cooldown: 60
- StepAdjustments:
- - ScalingAdjustment: 1
- MetricIntervalLowerBound: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement