aws/aws-cdk

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

Open

Aperta il 16 dic 2025

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (10.710 star) (3530 fork)batch import
@aws-cdk/aws-applicationautoscalingeffort/smallfeature-requestgood first issuep2

Descrizione

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

Guida contributor