-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
let's see if sonar is happy now
- Loading branch information
Showing
1 changed file
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import { Annotations } from "aws-cdk-lib"; | ||
import { Construct } from "constructs"; | ||
import * as featureFlags from "../feature-flags"; | ||
import { | ||
useLegacyTags, | ||
useCompatibilityV0Tags, | ||
LEGACY_TAGS_CONTEXT_KEY, | ||
V0_TAGS_CONTEXT_KEY, | ||
} from "../feature-flags"; | ||
|
||
export function warnAboutDeprecatedTags(scope: Construct) { | ||
if (featureFlags.useLegacyTags(scope)) { | ||
if (useLegacyTags(scope)) { | ||
Annotations.of(scope).addWarningV2( | ||
"@alma-cdk/project@v1:legacy-tags", | ||
`Using @almamedia-cdk/tag-and-name (for AWS CDK v1) construct's legacy tagging behavior via "${featureFlags.LEGACY_TAGS_CONTEXT_KEY}" context key. This is not encouraged and will be removed in v2.`, | ||
`Using @almamedia-cdk/tag-and-name (for AWS CDK v1) construct's legacy tagging behavior via "${LEGACY_TAGS_CONTEXT_KEY}" context key. This is not encouraged and will be removed in v2.`, | ||
); | ||
} | ||
|
||
if (featureFlags.useCompatibilityV0Tags(scope)) { | ||
if (useCompatibilityV0Tags(scope)) { | ||
Annotations.of(scope).addWarningV2( | ||
"@alma-cdk/project@v1:compatibility-v0-tags", | ||
`Using @alma-cdk/project@v0 construct's tagging behavior via "${featureFlags.V0_TAGS_CONTEXT_KEY}" context key. You should migrate to using the default tagging behavior as this feature flag will be removed in v2.`, | ||
`Using @alma-cdk/project@v0 construct's tagging behavior via "${V0_TAGS_CONTEXT_KEY}" context key. You should migrate to using the default tagging behavior as this feature flag will be removed in v2.`, | ||
); | ||
} | ||
} |