Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(spec2cdk): add tsdoc comment to describe the existance of a hardcoded list of resources in spec2cdk #32616

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tools/@aws-cdk/spec2cdk/lib/cdk/tagging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ export function resourceTaggabilityStyle(resource: Resource): TaggabilityStyle |
return undefined;
}

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