Skip to content

Commit 3ae33c0

Browse files
committed
add tsdoc to describe legacy taggables
1 parent ff57cc3 commit 3ae33c0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/@aws-cdk/spec2cdk/lib/cdk/tagging.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ export function resourceTaggabilityStyle(resource: Resource): TaggabilityStyle |
3232
return undefined;
3333
}
3434

35+
/**
36+
* Mapping of legacy taggable resources to their tag property name and variant
37+
*
38+
* Before the introduction of iTaggablev2 the CDK defined a `tags` property on constructs
39+
* which contained the tagManager, however in cases where the resource itself contained a
40+
* property named 'tags', the CDK would create a `tagsRaw` property to represent that CFN tags property.
41+
*
42+
* Upon the introduction of iTaggablev2, the CDK now uses the `cdkTagManager` property to manage tags.
43+
* This mapping of legacy resources is used to preserve the legacy behavior of tagging resources so that customers
44+
* who previously were tagging these constructs using `myConstruct.tags.setTag('key', 'value')` will
45+
* continue to be able to do so, without breaking changes.
46+
*/
3547
const LEGACY_TAGGABLES: Record<string, [string, TagInformation['variant']]> = {
3648
'AWS::ACMPCA::CertificateAuthority': ['Tags', 'standard'],
3749
'AWS::AccessAnalyzer::Analyzer': ['Tags', 'standard'],

0 commit comments

Comments
 (0)