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
Hi Didier,
It is MySQL Aurora version 8.0.mysql_aurora.3.05.1(latest version).
Thanks,