You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(core): ITaggableV2 is safe to implement for L1s (#25610)
`ITaggable` defines a property: `tags: TagManager`.
This definition conflicts with many L1 resources: they have `<cfnProperty>: <PropType>` properties on them, and if a property is named `tags` they conflict.
The old behavior is to have `tags: TagManager` for a select set of resources we recognize, and `tags: CfnResource.TagProperty[]` for all other resources.
There is occlusion whichever way we choose these properties.
Introduce a new interface, `ITaggable2 { tagManager: TagManager }`. I'm going to state there is *very little chance* of upstream properties being called `TagManager`, and so we can have both the `tags: CnfResource.TagProperty[]` property as well as the `tagManager: TagManager` property.
The plan is to generate one of the following L1 patterns:
```ts
// Old
class CfnSomething implements ITaggable {
readonly tags: TagManager; // Backwards compatible
tagsRaw: CfnSomething.TagProperty[]; // Also allow direct access
}
// New
class CfnSomething implements ITaggable2 {
readonly tags: CfnSomething.TagProperty[]; // Backwards compatible
readonly cdkTagManager: TagManager; // Allow access to the TagManager
}
```
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
0 commit comments