From 48c4208616e4dcd349670131fcad1fc9827e3ce7 Mon Sep 17 00:00:00 2001 From: Zac Brydon <52645024+zbrydon@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:54:26 +1000 Subject: [PATCH] Add tags lambda sqs worker cdk template (#1643) --- .changeset/hungry-keys-cover.md | 5 +++++ template/lambda-sqs-worker-cdk/infra/config.ts | 2 +- template/lambda-sqs-worker-cdk/infra/index.ts | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .changeset/hungry-keys-cover.md diff --git a/.changeset/hungry-keys-cover.md b/.changeset/hungry-keys-cover.md new file mode 100644 index 000000000..4ff01c6b1 --- /dev/null +++ b/.changeset/hungry-keys-cover.md @@ -0,0 +1,5 @@ +--- +'skuba': patch +--- + +template: Add required tags to `lambda-sqs-worker-cdk` template diff --git a/template/lambda-sqs-worker-cdk/infra/config.ts b/template/lambda-sqs-worker-cdk/infra/config.ts index aeb7aac0e..73f7dabe7 100644 --- a/template/lambda-sqs-worker-cdk/infra/config.ts +++ b/template/lambda-sqs-worker-cdk/infra/config.ts @@ -4,7 +4,7 @@ const ENVIRONMENTS = ['dev', 'prod'] as const; type Environment = (typeof ENVIRONMENTS)[number]; -const environment = Env.oneOf(ENVIRONMENTS)('ENVIRONMENT'); +export const environment = Env.oneOf(ENVIRONMENTS)('ENVIRONMENT'); interface Config { appName: string; diff --git a/template/lambda-sqs-worker-cdk/infra/index.ts b/template/lambda-sqs-worker-cdk/infra/index.ts index bc43ca2f9..5c7fa123f 100644 --- a/template/lambda-sqs-worker-cdk/infra/index.ts +++ b/template/lambda-sqs-worker-cdk/infra/index.ts @@ -1,11 +1,17 @@ import { App } from 'aws-cdk-lib'; import { AppStack } from './appStack'; -import { config } from './config'; +import { config, environment } from './config'; const app = new App(); // eslint-disable-next-line no-new new AppStack(app, 'appStack', { stackName: config.appName, + tags: { + 'seek:env:label': environment, + 'seek:source:sha': process.env.BUILDKITE_COMMIT ?? 'na', + // 'seek:source:url': 'TODO: add source URL', + // 'seek:system:name': 'TODO: add system name', + }, });