|
1 | 1 | import { Stack, Tags } from 'aws-cdk-lib'; |
2 | | -import { IConstruct } from 'constructs'; |
3 | | -import { SharedProps } from './SharedProps'; |
4 | 2 | import { Env } from './Types'; |
5 | 3 |
|
6 | | -interface SharedTagsProps { |
7 | | - shared: SharedProps; |
8 | | -} |
9 | | - |
10 | 4 | export class SharedTags { |
11 | | - public static addSharedTags(construct: IConstruct): void { |
12 | | - Tags.of(construct).add('repository', 'https://github.com/pwrdrvr/microapps-core/'); |
13 | | - Tags.of(construct).add( |
| 5 | + public static addSharedTags(stack: Stack): void { |
| 6 | + Tags.of(stack).add('repository', 'https://github.com/pwrdrvr/microapps-core/'); |
| 7 | + Tags.of(stack).add( |
14 | 8 | 'application', |
15 | 9 | // Note: this value is excluded from the strict S3 deny rules in microapps-cdk, |
16 | | - // which will allow the TTL deletion lambda in this construct to delete the S3 |
| 10 | + // which will allow the TTL deletion lambda in this stack to delete the S3 |
17 | 11 | // buckets - if these tags do not match then the delete by the lambda will fail. |
18 | | - `${Stack.of(construct).stackName}`, |
| 12 | + `${stack.stackName}`, |
19 | 13 | ); |
20 | 14 | } |
21 | 15 |
|
22 | | - public static addEnvTag(construct: IConstruct, env: Env | '', isEphemeral: boolean): void { |
23 | | - if (env !== '' && env !== undefined) Tags.of(construct).add('environment', env); |
| 16 | + public static addEnvTag(stack: Stack, env: Env | '', isEphemeral: boolean): void { |
| 17 | + if (env !== '' && env !== undefined) Tags.of(stack).add('environment', env); |
24 | 18 | if (isEphemeral) { |
25 | | - Tags.of(construct).add('ephemeral', 'true'); |
| 19 | + Tags.of(stack).add('ephemeral', 'true'); |
26 | 20 | // Note: a dynamic timestamp tag causes all dependency stacks |
27 | 21 | // to redeploy to update the timestamp tag, which takes forever with |
28 | 22 | // CloudFront. It may be possible to preserve this in `cdk.context.json` |
|
0 commit comments