Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Nov 27, 2025

Reason for this change

Today, out of 1512 resources, 892 have an arnFor${Resource} getter function (~58%).
The reasons are varied, but it comes done to us not being able to identify the required resource properties in an automated way.

Description of changes

We are adding a few additional heuristics to the matching:

  • If we cannot find an Arn property for a resource, but can match all variables of its arn template to properties, we can use that to interpolate the Arn . (37 additional resources)
  • A property may now also be called or end in ARN (all caps). (9 additional resources)
  • Some resources use a property name prefix that is different than their resource name, e.g. AWS::BedrockAgentCore::Runtime uses AgentRuntime instead of the expected Runtime. We extract this prefix from a primary identifier if it is ending in Id. (2 additional resources)

This brings our total count to 939 or ~62%. A little better!

PR also includes a major refactor of how reference props and now arn getters are organized. A lot of code depends on this information, so best to centralize the logic for it.

Describe any new or updated permissions being added

n/a

Description of how you validated changes

Existing and additional tests.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team November 27, 2025 16:58
@github-actions github-actions bot added the p2 label Nov 27, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 27, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@mrgrain mrgrain force-pushed the mrgrain/feat/arnForResource-for-more-resources branch 3 times, most recently from 5e6c194 to 2c3d8af Compare November 28, 2025 21:15
@mrgrain mrgrain added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Nov 28, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 28, 2025 21:45

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mrgrain mrgrain force-pushed the mrgrain/feat/arnForResource-for-more-resources branch from 2c3d8af to d79cbcc Compare November 28, 2025 21:46
@mrgrain mrgrain marked this pull request as ready for review November 28, 2025 22:09
@mrgrain mrgrain force-pushed the mrgrain/feat/arnForResource-for-more-resources branch from d79cbcc to 0528641 Compare November 28, 2025 22:22
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 28, 2025
@mrgrain mrgrain changed the title fix: add arnForResource for x more resources fix: add arnForResource for 47 more resources Nov 29, 2025
@mrgrain mrgrain changed the title fix: add arnForResource for 47 more resources fix(aws-cdk-lib): add arnForResource for 47 more resources Nov 29, 2025
@mrgrain mrgrain changed the title fix(aws-cdk-lib): add arnForResource for 47 more resources fix(aws-cdk-lib): add arnFor<ResourceName> for 47 more resources Nov 29, 2025
@mrgrain mrgrain changed the title fix(aws-cdk-lib): add arnFor<ResourceName> for 47 more resources feat(aws-cdk-lib): add arnFor<ResourceName> for 47 more resources Nov 29, 2025
@mrgrain mrgrain added the pr-linter/exempt-readme The PR linter will not require README changes label Nov 29, 2025
@mergify
Copy link
Contributor

mergify bot commented Dec 1, 2025

Merge Queue Status Beta

✅ The pull request has been merged

This pull request spent 46 minutes 6 seconds in the queue, including 45 minutes 55 seconds waiting for CI.
The checks were run in-place.

Required conditions to merge

@mergify
Copy link
Contributor

mergify bot commented Dec 1, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Dec 1, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 5a8be4f into main Dec 1, 2025
16 of 17 checks passed
@mergify mergify bot deleted the mrgrain/feat/arnForResource-for-more-resources branch December 1, 2025 09:59
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants