(Application Autoscaling): Access the ARN or "unique identifier" of a ScalableTarget
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Currently, for the Application Autoscaling ScalableTarget, there is the [scalableTargetId field](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_applicationautoscaling.ScalableTarget.html#scalabletargetid). This represents the `ResourceId` in a request made to the [RegisterScalableTarget API](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestSyntax).
If possible, we would like to access the ARN or the unique id of the scalable target itself, as described in the "Resources" subsection of the "Identity-based policies" section [here](https://docs.aws.amazon.com/autoscaling/application/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies)
### Use Case
We want to create identity-based policies for IAM roles to better control access to auto-scaling. We would like to create these roles using CDK because we have a multi-region architecture and need to set up these roles in multiple accounts per region. In order to create the roles, we need to access the Application Autoscaling unique identifier or ARN (like `arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123`). We want to avoid using wildcards in the resource field because each account manages multiple auto scaling targets.
### Proposed Solution
_No response_
### Other Information
We could implement this by using a custom Lambda-based CloudFormation resource that calls the Application Autoscaling API directly. However, if possible, we would like to avoid using custom resources as the code that implements the custom functionality is separated from the code that defines the rest of our stacks.
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.115.0
### Environment details (OS name and version, etc.)
macOS 13.6.2
Contributor guide
Research direction
Start by locating the TypeScript implementation of Application Autoscaling ScalableTarget and reviewing how scalableTargetId maps to the RegisterScalableTarget API. Compare the available construct attributes with the AWS documentation for the scalable target ARN or unique identifier. Done means the construct exposes the identifier needed to scope IAM policies without a custom resource, with tests covering the new behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100