Hello everyone, I tried to create a app scaling po...
# typescript
n
Hello everyone, I tried to create a app scaling policy for RDS cluster but I’m getting the below error message. I confirmed with AWS doc that all the given params are correct and supported but still i’m facing this issue.
creating Application AutoScaling Target: ValidationException: Unsupported service namespace, resource type or scalable dimension
Did anyone face this kinda issue or any idea on this? Please help me with this. Thanks The script is here,
Copy code
// RDS Auto Scaling Policy based on Memory Utilization
export function appMemoryScalingPolicy(rdsCpuScalingArgs: any) {
    const {
      clusterId,
      minCapacity = 1,
      maxCapacity = 2,
      targetValue = 70,
      scaleInCooldown = 300,
      scaleOutCooldown = 300,
      disableScaleIn = false,
    } = rdsCpuScalingArgs;
    const scalingTarget = new aws.appautoscaling.Target("rdsCpuScalingTarget", {
      serviceNamespace: "rds",
      scalableDimension: "rds:cluster:ReadReplicaCount",
      resourceId: `cluster:${clusterId}`,
      minCapacity: minCapacity,
      maxCapacity: maxCapacity,
    });
    return new aws.appautoscaling.Policy("rdsCpuScalingPolicy", {
      serviceNamespace: scalingTarget.serviceNamespace,
      scalableDimension: scalingTarget.scalableDimension,
      resourceId: scalingTarget.resourceId,
      policyType: "TargetTrackingScaling",
      targetTrackingScalingPolicyConfiguration: {
        customizedMetricSpecification: {
          metricName: "FreeableMemory",
          namespace: "AWS/RDS",
          statistic: "Average",
          unit: "Bytes"
        },
        targetValue: targetValue,
        scaleInCooldown: scaleInCooldown,
        scaleOutCooldown: scaleOutCooldown,
        disableScaleIn: disableScaleIn,
      },
    });
  }
q
I haven’t used autoscaling with RDS, but the syntax looks ok to me—it matches an ECS autoscaling target in my codebase I can see that the doco explicitly says it’s supported for Aurora for MySQL and Aurora for Postgres: https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#autoscaling-RegisterScal[…]equest-ScalableDimension I don’t suppose you’re trying to use a database engine? Or possibly a non-Aurora (plain RDS) cluster?
n
I actually tried for both aurora and non aurora postgresql clusters and I got the same error for both.
Also, I did try for ECS Scaling as well with the same
appscaling target
and that also didn’t work.. same error there 😐 I’m suspecting whether this is a bug or something. Am I the only one who face this kinda error ?🤔
Still struggling with this issue. The experts help or ideas are much appreciated here. Thanks