RDS autoscaling through cloudformation

0

I'm trying to create a scaling policy for RDS, but I keep getting a cfn-lint error, and the update fails with an error in cloudformation as well. I followed the documentation. Here's the documentation where I got the "RDSReaderAverageCPUUtilization" from. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification.html

Here's the snippet of the scaling policy. cfn-lint is explicitly complaining about

  ScalingPolicy:
    Type: AWS::AutoScalingPlans::ScalingPlan
    Properties:
      ApplicationSource: 
        TagFilters:
          - Key: Name
            Values:
              - !Ref Name
      ScalingInstructions: 
        - MinCapacity: 1
          MaxCapacity: 15
          ServiceNamespace: !Sub '${DatabaseName}-autoscaling'
          ScalableDimension: rds:cluster:ReadReplicaCount
          ResourceId: !Sub 'cluster:${DatabaseName}'
          TargetTrackingConfigurations:
            - PredefinedScalingMetricSpecification:
                PredefinedScalingMetricType: "RDSReaderAverageCPUUtilization"
              TargetValue: !Ref TargetValue
              ScaleInCooldown: 300
              ScaleOutCooldown: 300
              EstimatedInstanceWarmup: 300

cfn-lint error:

E3030 You must specify a valid value for PredefinedScalingMetricType (RDSReaderAverageCPUUtilization). Valid values are ["ALBRequestCountPerTarget", "ASGAverageCPUUtilization", "ASGAverageNetworkIn", "ASGAverageNetworkOut"]

Even though I have this cfn-lint was complaining I still tried running the template and got the following from cloudformation:

1 validation error detected: Value 'mysql-autoscaling' at 'scalingInstructions.1.member.serviceNamespace' failed to satisfy constraint: Member must satisfy enum value set: [rds, dynamodb, ec2, ecs, autoscaling] (Service: AWSAutoScalingPlans; Status Code: 400; Error Code: ValidationException; Request ID: c45c24e7-5ff4-4e28-bb83-80e23cb7689c; Proxy: null)

Please advise

已提問 4 個月前檢視次數 265 次
1 個回答
0

Hi,

Is your DB instance a MySQL Aurora instance and not standard RDS?

Asking because of the doc at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-scalabledimension saying

rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for 
Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.

Best,

Didier

profile pictureAWS
專家
已回答 4 個月前
  • Hi Didier,

    It is MySQL Aurora version 8.0.mysql_aurora.3.05.1(latest version).

    Thanks,

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南