aws/aws-cdk

aws-applicationautoscaling: Target Tracking Scaling Policy does not support account for custom metric

Open

#36401 opened on Dec 16, 2025

View on GitHub
 (2 comments) (0 reactions) (0 assignees)TypeScript (10,710 stars) (3,530 forks)batch import
@aws-cdk/aws-applicationautoscalingeffort/smallfeature-requestgood first issuep2

Description

Describe the bug

Target Scaling Policy does not return the account information from the metric so cross account metric cannot be used.

https://github.com/aws/aws-cdk/blob/244c02de488a9dfe7dad9eca1e9bb301863216bc/packages/aws-cdk-lib/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts#L170

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Library Version

No response

Expected Behavior

The renderCustomMetric function the target tracking policy should return the account from the metric as well

https://github.com/aws/aws-cdk/blob/244c02de488a9dfe7dad9eca1e9bb301863216bc/packages/aws-cdk-lib/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts#L162C10-L162C28

Current Behavior

The account information is never fetched from the metric so it default to the current account when creating it

Reproduction Steps

Create a Target Tracking Policy using a Custom Metric and specify the a different account for the metric and it will be ignored

Possible Solution

No response

Additional Information/Context

No response

AWS CDK Library version (aws-cdk-lib)

2.223.0

AWS CDK CLI version

2.1031.2

Node.js Version

22.9.0

OS

Amazon Linux 2023

Language

Python

Language Version

3.11

Other information

No response

Contributor guide