Commit 5a8be4f
authored
feat(aws-cdk-lib): add
### 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](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrockagentcore-runtime.html) 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
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*arnFor<ResourceName> for 47 more resources (#36231)1 parent 3d6b204 commit 5a8be4f
File tree
21 files changed
+491
-147
lines changed- packages/@aws-cdk/mixins-preview
- lib/services
- aws-rum
- aws-sagemaker
- scripts
- spec2eventbridge
- spec2logs
- test
- codegen
- events
- tools/@aws-cdk/spec2cdk
- lib
- cdk
- naming
- test
21 files changed
+491
-147
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 14 | | |
27 | 15 | | |
28 | 16 | | |
29 | 17 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 18 | | |
35 | 19 | | |
36 | 20 | | |
| |||
39 | 23 | | |
40 | 24 | | |
41 | 25 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 26 | | |
51 | 27 | | |
52 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
53 | 33 | | |
54 | 34 | | |
55 | 35 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
489 | 490 | | |
490 | 491 | | |
491 | 492 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
Lines changed: 3 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 12 | + | |
21 | 13 | | |
22 | 14 | | |
23 | 15 | | |
| |||
47 | 39 | | |
48 | 40 | | |
49 | 41 | | |
50 | | - | |
| 42 | + | |
| 43 | + | |
51 | 44 | | |
52 | 45 | | |
53 | 46 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
0 commit comments