Skip to content

Commit 5a918d1

Browse files
authored
fix(spec2cdk): get tag gives null result in Java CDK (#29870)
### Issue # (if applicable) Closes #29869 ### Reason for this change Without it, it breaks java users who rely on tagging name to generate resource id. ### Description of changes Provide a default value using the initial `tagValue` users provide. ### Description of how you validated changes Existing tests all pass. Essentially changing it back to the original state. ### Checklist - [ ] 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*
1 parent f4af330 commit 5a918d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/@aws-cdk/spec2cdk/lib/cdk/resource-decider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ export class ResourceDecider {
153153
summary: 'Tag Manager which manages the tags for this resource',
154154
},
155155
},
156-
initializer: (_: Expression) =>
156+
initializer: (props: Expression) =>
157157
new CDK_CORE.TagManager(
158158
this.tagManagerVariant(variant),
159159
expr.lit(this.resource.cloudFormationType),
160-
expr.UNDEFINED,
160+
$E(props)[originalName],
161161
expr.object({ tagPropertyName: expr.lit(originalName) }),
162162
),
163163
cfnValueToRender: {
164-
[originalName]: $this.tags.renderTags($this[rawTagsPropName]),
164+
[originalName]: $this.tags.renderTags(),
165165
},
166166
},
167167
{

0 commit comments

Comments
 (0)