skuba 13.0.0-subpath-imports-20250730060533 → 13.0.0-subpath-imports-20251003044159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/config/tsconfig.json +2 -1
- package/jest/moduleNameMapper.js +3 -11
- package/lib/cli/build/assets.js +4 -8
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/esbuild.d.ts +2 -1
- package/lib/cli/build/esbuild.js +5 -4
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +9 -5
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/build/tsc.d.ts +9 -2
- package/lib/cli/build/tsc.js +76 -40
- package/lib/cli/build/tsc.js.map +3 -3
- package/lib/cli/configure/analyseDependencies.d.ts +2 -2
- package/lib/cli/configure/analyseDependencies.js.map +1 -1
- package/lib/cli/configure/analysis/package.d.ts +1 -1
- package/lib/cli/configure/analysis/package.js +1 -1
- package/lib/cli/configure/analysis/package.js.map +2 -2
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +2 -2
- package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
- package/lib/cli/configure/getEntryPoint.d.ts +2 -2
- package/lib/cli/configure/getEntryPoint.js.map +1 -1
- package/lib/cli/configure/getProjectType.d.ts +2 -2
- package/lib/cli/configure/getProjectType.js.map +1 -1
- package/lib/cli/configure/processing/configFile.d.ts +1 -1
- package/lib/cli/configure/processing/configFile.js +48 -6
- package/lib/cli/configure/processing/configFile.js.map +2 -2
- package/lib/cli/configure/processing/package.js +8 -2
- package/lib/cli/configure/processing/package.js.map +2 -2
- package/lib/cli/init/getConfig.js +1 -1
- package/lib/cli/init/getConfig.js.map +2 -2
- package/lib/cli/init/git.js +1 -1
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.js +4 -4
- package/lib/cli/init/index.js.map +3 -3
- package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/index.js +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/github/eslint.d.ts +1 -1
- package/lib/cli/lint/annotate/github/eslint.js.map +2 -2
- package/lib/cli/lint/annotate/github/index.js +3 -4
- package/lib/cli/lint/annotate/github/index.js.map +2 -2
- package/lib/cli/lint/annotate/github/internal.d.ts +1 -1
- package/lib/cli/lint/annotate/github/internal.js.map +2 -2
- package/lib/cli/lint/annotate/github/prettier.d.ts +1 -1
- package/lib/cli/lint/annotate/github/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/github/tsc.d.ts +1 -1
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/autofix.d.ts +1 -1
- package/lib/cli/lint/autofix.js +3 -3
- package/lib/cli/lint/autofix.js.map +2 -2
- package/lib/cli/lint/internal.js +1 -1
- package/lib/cli/lint/internal.js.map +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +3 -3
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +5 -3
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +4 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +162 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.d.ts +2 -0
- package/lib/{api/buildkite → cli/lint/internalLints/upgrade/patches/12.1.1}/index.js +12 -9
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +105 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.d.ts +2 -0
- package/lib/{api/git/statusMatrix.js → cli/lint/internalLints/upgrade/patches/12.3.0/index.js} +18 -25
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +100 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +99 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +2 -0
- package/lib/{api/buildkite/md.js → cli/lint/internalLints/upgrade/patches/12.4.0/index.js} +13 -11
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +101 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.d.ts +2 -0
- package/lib/{api/net → cli/lint/internalLints/upgrade/patches/13.0.0}/index.js +12 -6
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.d.ts +13 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js +221 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
- package/lib/cli/node/index.js +6 -0
- package/lib/cli/node/index.js.map +2 -2
- package/lib/cli/start/index.js +6 -0
- package/lib/cli/start/index.js.map +2 -2
- package/lib/cli/test/index.d.ts +1 -1
- package/lib/cli/test/index.js +18 -4
- package/lib/cli/test/index.js.map +2 -2
- package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
- package/lib/cli/test/reporters/github/annotations.js.map +1 -1
- package/lib/cli/test/reporters/github/index.js +3 -4
- package/lib/cli/test/reporters/github/index.js.map +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +4 -4
- package/lib/index.js.map +2 -2
- package/lib/utils/args.d.ts +2 -0
- package/lib/utils/args.js +5 -0
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/dir.js +2 -2
- package/lib/utils/dir.js.map +3 -3
- package/lib/utils/manifest.d.ts +6 -2
- package/lib/utils/manifest.js +17 -8
- package/lib/utils/manifest.js.map +2 -2
- package/lib/utils/template.d.ts +1 -1
- package/package.json +19 -21
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +11 -0
- package/template/base/jest.config.ts +4 -0
- package/template/base/jest.setup.ts +1 -1
- package/template/express-rest-api/.buildkite/pipeline.yml +6 -0
- package/template/express-rest-api/.env +1 -1
- package/template/express-rest-api/.gantry/dev.yml +5 -1
- package/template/express-rest-api/.gantry/prod.yml +5 -1
- package/template/express-rest-api/Dockerfile +2 -2
- package/template/express-rest-api/Dockerfile.dev-deps +0 -2
- package/template/express-rest-api/README.md +5 -5
- package/template/express-rest-api/gantry.apply.yml +17 -1
- package/template/express-rest-api/package.json +11 -5
- package/template/express-rest-api/src/api/healthCheck.ts +2 -2
- package/template/express-rest-api/src/config.ts +7 -7
- package/template/express-rest-api/src/framework/logging.ts +11 -7
- package/template/express-rest-api/src/framework/metrics.ts +1 -1
- package/template/express-rest-api/src/listen.ts +6 -0
- package/template/express-rest-api/src/tracing.ts +56 -0
- package/template/greeter/Dockerfile +0 -2
- package/template/greeter/README.md +2 -2
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +6 -0
- package/template/koa-rest-api/.env +1 -1
- package/template/koa-rest-api/.gantry/dev.yml +3 -3
- package/template/koa-rest-api/.gantry/prod.yml +3 -3
- package/template/koa-rest-api/Dockerfile +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +0 -2
- package/template/koa-rest-api/README.md +6 -6
- package/template/koa-rest-api/gantry.apply.yml +15 -3
- package/template/koa-rest-api/package.json +10 -11
- package/template/koa-rest-api/src/api/healthCheck.ts +2 -2
- package/template/koa-rest-api/src/config.ts +7 -7
- package/template/koa-rest-api/src/framework/logging.ts +12 -8
- package/template/koa-rest-api/src/framework/metrics.ts +1 -1
- package/template/koa-rest-api/src/framework/server.test.ts +7 -8
- package/template/koa-rest-api/src/framework/server.ts +1 -4
- package/template/koa-rest-api/src/listen.ts +6 -0
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +6 -2
- package/template/lambda-sqs-worker-cdk/.env +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +0 -2
- package/template/lambda-sqs-worker-cdk/README.md +8 -8
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +54 -26
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +5 -22
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +16 -9
- package/template/lambda-sqs-worker-cdk/infra/config.ts +34 -20
- package/template/lambda-sqs-worker-cdk/infra/index.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +7 -9
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +91 -51
- package/template/lambda-sqs-worker-cdk/src/app.ts +10 -9
- package/template/lambda-sqs-worker-cdk/src/config.ts +11 -16
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +10 -5
- package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +48 -24
- package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -11
- package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -4
- package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +4 -1
- package/template/oss-npm-package/.github/workflows/release.yml +7 -8
- package/template/oss-npm-package/.github/workflows/validate.yml +6 -6
- package/template/oss-npm-package/README.md +1 -1
- package/template/oss-npm-package/_package.json +0 -3
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/lib/api/buildkite/annotate.d.ts +0 -28
- package/lib/api/buildkite/annotate.js +0 -62
- package/lib/api/buildkite/annotate.js.map +0 -7
- package/lib/api/buildkite/index.d.ts +0 -3
- package/lib/api/buildkite/index.js.map +0 -7
- package/lib/api/buildkite/md.d.ts +0 -6
- package/lib/api/buildkite/md.js.map +0 -7
- package/lib/api/git/commit.d.ts +0 -15
- package/lib/api/git/commit.js +0 -52
- package/lib/api/git/commit.js.map +0 -7
- package/lib/api/git/commitAllChanges.d.ts +0 -19
- package/lib/api/git/commitAllChanges.js +0 -83
- package/lib/api/git/commitAllChanges.js.map +0 -7
- package/lib/api/git/currentBranch.d.ts +0 -10
- package/lib/api/git/currentBranch.js +0 -59
- package/lib/api/git/currentBranch.js.map +0 -7
- package/lib/api/git/findRoot.d.ts +0 -9
- package/lib/api/git/findRoot.js +0 -52
- package/lib/api/git/findRoot.js.map +0 -7
- package/lib/api/git/getChangedFiles.d.ts +0 -20
- package/lib/api/git/getChangedFiles.js +0 -81
- package/lib/api/git/getChangedFiles.js.map +0 -7
- package/lib/api/git/index.d.ts +0 -12
- package/lib/api/git/index.js +0 -61
- package/lib/api/git/index.js.map +0 -7
- package/lib/api/git/isFileGitIgnored.d.ts +0 -4
- package/lib/api/git/isFileGitIgnored.js +0 -49
- package/lib/api/git/isFileGitIgnored.js.map +0 -7
- package/lib/api/git/log.d.ts +0 -19
- package/lib/api/git/log.js +0 -71
- package/lib/api/git/log.js.map +0 -7
- package/lib/api/git/pull.d.ts +0 -35
- package/lib/api/git/pull.js +0 -69
- package/lib/api/git/pull.js.map +0 -7
- package/lib/api/git/push.d.ts +0 -52
- package/lib/api/git/push.js +0 -70
- package/lib/api/git/push.js.map +0 -7
- package/lib/api/git/remote.d.ts +0 -20
- package/lib/api/git/remote.js +0 -73
- package/lib/api/git/remote.js.map +0 -7
- package/lib/api/git/reset.d.ts +0 -12
- package/lib/api/git/reset.js +0 -62
- package/lib/api/git/reset.js.map +0 -7
- package/lib/api/git/statusMatrix.d.ts +0 -7
- package/lib/api/git/statusMatrix.js.map +0 -7
- package/lib/api/github/checkRun.d.ts +0 -44
- package/lib/api/github/checkRun.js +0 -81
- package/lib/api/github/checkRun.js.map +0 -7
- package/lib/api/github/environment.d.ts +0 -17
- package/lib/api/github/environment.js +0 -48
- package/lib/api/github/environment.js.map +0 -7
- package/lib/api/github/index.d.ts +0 -7
- package/lib/api/github/index.js +0 -48
- package/lib/api/github/index.js.map +0 -7
- package/lib/api/github/issueComment.d.ts +0 -61
- package/lib/api/github/issueComment.js +0 -99
- package/lib/api/github/issueComment.js.map +0 -7
- package/lib/api/github/octokit.d.ts +0 -6
- package/lib/api/github/octokit.js +0 -42
- package/lib/api/github/octokit.js.map +0 -7
- package/lib/api/github/pullRequest.d.ts +0 -21
- package/lib/api/github/pullRequest.js +0 -69
- package/lib/api/github/pullRequest.js.map +0 -7
- package/lib/api/github/push.d.ts +0 -85
- package/lib/api/github/push.js +0 -166
- package/lib/api/github/push.js.map +0 -7
- package/lib/api/net/compose.d.ts +0 -4
- package/lib/api/net/compose.js +0 -51
- package/lib/api/net/compose.js.map +0 -7
- package/lib/api/net/index.d.ts +0 -1
- package/lib/api/net/index.js.map +0 -7
- package/lib/api/net/socket.d.ts +0 -5
- package/lib/api/net/socket.js +0 -68
- package/lib/api/net/socket.js.map +0 -7
- package/lib/api/net/waitFor.d.ts +0 -22
- package/lib/api/net/waitFor.js +0 -40
- package/lib/api/net/waitFor.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/rewriteSrcImports.d.ts +0 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/rewriteSrcImports.js +0 -104
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/rewriteSrcImports.js.map +0 -7
|
@@ -32,7 +32,6 @@ describe('createApp', () => {
|
|
|
32
32
|
|
|
33
33
|
expect(stdoutMock.calls).toHaveLength(0);
|
|
34
34
|
|
|
35
|
-
metricsClient.expectTagSubset(['env:test', 'version:test']);
|
|
36
35
|
metricsClient.expectTagSubset([
|
|
37
36
|
'http_method:get',
|
|
38
37
|
'http_status:200',
|
|
@@ -133,7 +132,7 @@ describe('createApp', () => {
|
|
|
133
132
|
|
|
134
133
|
expect(stdoutMock.calls).toMatchObject([
|
|
135
134
|
{
|
|
136
|
-
|
|
135
|
+
error: {
|
|
137
136
|
statusCode: 400,
|
|
138
137
|
type: 'BadRequestError',
|
|
139
138
|
},
|
|
@@ -167,7 +166,7 @@ describe('createApp', () => {
|
|
|
167
166
|
|
|
168
167
|
expect(stdoutMock.calls).toMatchObject([
|
|
169
168
|
{
|
|
170
|
-
|
|
169
|
+
error: {
|
|
171
170
|
statusCode: 500,
|
|
172
171
|
type: 'InternalServerError',
|
|
173
172
|
},
|
|
@@ -203,7 +202,7 @@ describe('createApp', () => {
|
|
|
203
202
|
|
|
204
203
|
expect(stdoutMock.calls).toMatchObject([
|
|
205
204
|
{
|
|
206
|
-
|
|
205
|
+
error: {
|
|
207
206
|
message: err.message,
|
|
208
207
|
type: 'Error',
|
|
209
208
|
},
|
|
@@ -237,7 +236,7 @@ describe('createApp', () => {
|
|
|
237
236
|
|
|
238
237
|
expect(stdoutMock.calls).toMatchObject([
|
|
239
238
|
{
|
|
240
|
-
|
|
239
|
+
error: null,
|
|
241
240
|
level: 50,
|
|
242
241
|
method: 'GET',
|
|
243
242
|
msg: 'Server error',
|
|
@@ -256,10 +255,10 @@ describe('createApp', () => {
|
|
|
256
255
|
});
|
|
257
256
|
|
|
258
257
|
it('handles string error', async () => {
|
|
259
|
-
const
|
|
258
|
+
const error = chance.sentence();
|
|
260
259
|
|
|
261
260
|
middleware.mockImplementation(() => {
|
|
262
|
-
throw
|
|
261
|
+
throw error;
|
|
263
262
|
});
|
|
264
263
|
|
|
265
264
|
await agent
|
|
@@ -270,7 +269,7 @@ describe('createApp', () => {
|
|
|
270
269
|
|
|
271
270
|
expect(stdoutMock.calls).toMatchObject([
|
|
272
271
|
{
|
|
273
|
-
|
|
272
|
+
error,
|
|
274
273
|
level: 50,
|
|
275
274
|
method: 'GET',
|
|
276
275
|
msg: 'Server error',
|
|
@@ -30,10 +30,7 @@ const requestLogging = RequestLogging.createMiddleware((ctx, fields, err) => {
|
|
|
30
30
|
: logger.error(fields, 'Server error');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
const version = VersionMiddleware.create(
|
|
34
|
-
name: config.name,
|
|
35
|
-
version: config.version,
|
|
36
|
-
});
|
|
33
|
+
const version = VersionMiddleware.create(config);
|
|
37
34
|
|
|
38
35
|
export const createApp = <State, Context>(
|
|
39
36
|
...middleware: Array<Koa.Middleware<State, Context>>
|
|
@@ -20,3 +20,9 @@ const listener = app.listen(config.port, () => {
|
|
|
20
20
|
// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout
|
|
21
21
|
// AWS recommends setting an application timeout larger than the load balancer
|
|
22
22
|
listener.keepAliveTimeout = 31000;
|
|
23
|
+
|
|
24
|
+
// Report unhandled rejections instead of crashing the process
|
|
25
|
+
// Make sure to monitor these reports and alert as appropriate
|
|
26
|
+
process.on('unhandledRejection', (err) =>
|
|
27
|
+
logger.error(err, 'Unhandled promise rejection'),
|
|
28
|
+
);
|
|
@@ -81,7 +81,9 @@ steps:
|
|
|
81
81
|
agents:
|
|
82
82
|
queue: <%- devBuildkiteQueueName %>
|
|
83
83
|
env:
|
|
84
|
-
|
|
84
|
+
DD_DEPLOYMENT_ENVIRONMENT: development
|
|
85
|
+
DD_DEPLOYMENT_SERVICE: <%- serviceName %>
|
|
86
|
+
DEPLOYMENT: dev
|
|
85
87
|
GET_NPM_TOKEN: please
|
|
86
88
|
label: 🤞 Deploy Dev
|
|
87
89
|
concurrency_group: '<%- repoName %>/deploy/dev'
|
|
@@ -89,7 +91,9 @@ steps:
|
|
|
89
91
|
|
|
90
92
|
- <<: *deploy
|
|
91
93
|
env:
|
|
92
|
-
|
|
94
|
+
DD_DEPLOYMENT_ENVIRONMENT: production
|
|
95
|
+
DD_DEPLOYMENT_SERVICE: <%- serviceName %>
|
|
96
|
+
DEPLOYMENT: prod
|
|
93
97
|
GET_NPM_TOKEN: please
|
|
94
98
|
label: 🚀 Deploy Prod
|
|
95
99
|
branches: ${BUILDKITE_PIPELINE_DEFAULT_BRANCH}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
DEPLOYMENT=local
|
|
@@ -54,7 +54,7 @@ pnpm test
|
|
|
54
54
|
awsauth
|
|
55
55
|
|
|
56
56
|
# Run smoke test against deployed application
|
|
57
|
-
|
|
57
|
+
DEPLOYMENT=dev pnpm smoke
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
### Lint
|
|
@@ -88,8 +88,8 @@ curl --data '[{}, {"awsRequestId": "local"}]' --include localhost:<%- port %>
|
|
|
88
88
|
|
|
89
89
|
This project is deployed through a [Buildkite pipeline](.buildkite/pipeline.yml).
|
|
90
90
|
|
|
91
|
-
- Commits to a feature branch can be deployed to the
|
|
92
|
-
- Commits to the default branch are automatically deployed to the
|
|
91
|
+
- Commits to a feature branch can be deployed to the development environment by unblocking a step in the Buildkite UI
|
|
92
|
+
- Commits to the default branch are automatically deployed to the development and production environments in sequence
|
|
93
93
|
|
|
94
94
|
To deploy locally:
|
|
95
95
|
|
|
@@ -97,7 +97,7 @@ To deploy locally:
|
|
|
97
97
|
# Authenticate to dev account
|
|
98
98
|
awsauth
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
DEPLOYMENT=dev pnpm run deploy
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
A hotswap deploy enables faster deployment but come with caveats such as requiring a Lambda to be rebuilt with every build.
|
|
@@ -108,19 +108,19 @@ To deploy a [hotswap]:
|
|
|
108
108
|
# Authenticate to dev account
|
|
109
109
|
awsauth
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
DEPLOYMENT=dev pnpm run deploy:hotswap
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
To rapidly roll back a change,
|
|
115
115
|
retry an individual deployment step from the previous build in Buildkite.
|
|
116
|
-
Note that this will introduce drift between the head of the default Git branch and the live
|
|
116
|
+
Note that this will introduce drift between the head of the default Git branch and the live deployment;
|
|
117
117
|
use with caution and always follow up with a proper revert or fix in Git history.
|
|
118
118
|
|
|
119
119
|
## Support
|
|
120
120
|
|
|
121
121
|
### Dev
|
|
122
122
|
|
|
123
|
-
TODO: add support links for the dev
|
|
123
|
+
TODO: add support links for the dev deployment.
|
|
124
124
|
|
|
125
125
|
<!--
|
|
126
126
|
- CloudWatch dashboard
|
|
@@ -130,7 +130,7 @@ TODO: add support links for the dev environment.
|
|
|
130
130
|
|
|
131
131
|
### Prod
|
|
132
132
|
|
|
133
|
-
TODO: add support links for the prod
|
|
133
|
+
TODO: add support links for the prod deployment.
|
|
134
134
|
|
|
135
135
|
<!--
|
|
136
136
|
- CloudWatch dashboard
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
4
4
|
{
|
|
@@ -173,35 +173,35 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
173
173
|
},
|
|
174
174
|
"S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
|
|
175
175
|
},
|
|
176
|
-
"Description": "Updated at 1212-12-12T12:12:12.121Z",
|
|
177
176
|
"Environment": {
|
|
178
177
|
"Variables": {
|
|
179
178
|
"DD_API_KEY_SECRET_ARN": {
|
|
180
179
|
"Ref": "datadogapikeysecret046FEF06",
|
|
181
180
|
},
|
|
182
181
|
"DD_CAPTURE_LAMBDA_PAYLOAD": "false",
|
|
182
|
+
"DD_ENV": "development",
|
|
183
183
|
"DD_FLUSH_TO_LOG": "false",
|
|
184
184
|
"DD_LAMBDA_HANDLER": "index.handler",
|
|
185
185
|
"DD_LOGS_INJECTION": "false",
|
|
186
186
|
"DD_MERGE_XRAY_TRACES": "false",
|
|
187
187
|
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
188
188
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
189
|
+
"DD_SERVICE": "serviceName",
|
|
189
190
|
"DD_SITE": "datadoghq.com",
|
|
190
191
|
"DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "$.*",
|
|
191
192
|
"DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "$.*",
|
|
192
193
|
"DD_TRACE_ENABLED": "true",
|
|
194
|
+
"DD_VERSION": "local",
|
|
195
|
+
"DEPLOYMENT": "dev",
|
|
193
196
|
"DESTINATION_SNS_TOPIC_ARN": {
|
|
194
197
|
"Ref": "destinationtopicDCE2E0B8",
|
|
195
198
|
},
|
|
196
|
-
"ENVIRONMENT": "dev",
|
|
197
199
|
"NODE_ENV": "production",
|
|
198
200
|
"NODE_OPTIONS": "--enable-source-maps",
|
|
199
|
-
"SERVICE": "serviceName",
|
|
200
|
-
"VERSION": "local",
|
|
201
201
|
},
|
|
202
202
|
},
|
|
203
203
|
"FunctionName": "serviceName",
|
|
204
|
-
"Handler": "node_modules/datadog-lambda-js/
|
|
204
|
+
"Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler",
|
|
205
205
|
"KmsKeyArn": {
|
|
206
206
|
"Fn::GetAtt": [
|
|
207
207
|
"kmskey49FBC3B3",
|
|
@@ -209,6 +209,18 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
209
209
|
],
|
|
210
210
|
},
|
|
211
211
|
"Layers": [
|
|
212
|
+
{
|
|
213
|
+
"Fn::Join": [
|
|
214
|
+
"",
|
|
215
|
+
[
|
|
216
|
+
"arn:aws:lambda:",
|
|
217
|
+
{
|
|
218
|
+
"Ref": "AWS::Region",
|
|
219
|
+
},
|
|
220
|
+
":464622532012:layer:Datadog-Node22-x:x",
|
|
221
|
+
],
|
|
222
|
+
],
|
|
223
|
+
},
|
|
212
224
|
{
|
|
213
225
|
"Fn::Join": [
|
|
214
226
|
"",
|
|
@@ -222,7 +234,8 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
222
234
|
],
|
|
223
235
|
},
|
|
224
236
|
],
|
|
225
|
-
"
|
|
237
|
+
"MemorySize": 512,
|
|
238
|
+
"ReservedConcurrentExecutions": 3,
|
|
226
239
|
"Role": {
|
|
227
240
|
"Fn::GetAtt": [
|
|
228
241
|
"workerServiceRole2130CC7F",
|
|
@@ -332,6 +345,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
332
345
|
},
|
|
333
346
|
"workerAliasLiveSqsEventSourceappStackworkerqueue8281B9F443B0CF93": {
|
|
334
347
|
"Properties": {
|
|
348
|
+
"BatchSize": 10,
|
|
335
349
|
"EventSourceArn": {
|
|
336
350
|
"Fn::GetAtt": [
|
|
337
351
|
"workerqueueA05CE5C6",
|
|
@@ -359,6 +373,12 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
359
373
|
],
|
|
360
374
|
],
|
|
361
375
|
},
|
|
376
|
+
"FunctionResponseTypes": [
|
|
377
|
+
"ReportBatchItemFailures",
|
|
378
|
+
],
|
|
379
|
+
"ScalingConfig": {
|
|
380
|
+
"MaximumConcurrency": 2,
|
|
381
|
+
},
|
|
362
382
|
"Tags": [
|
|
363
383
|
{
|
|
364
384
|
"Key": "aws-codedeploy-hooks",
|
|
@@ -743,14 +763,6 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
743
763
|
},
|
|
744
764
|
},
|
|
745
765
|
"Resources": {
|
|
746
|
-
"datadogapikeysecret046FEF06": {
|
|
747
|
-
"DeletionPolicy": "Delete",
|
|
748
|
-
"Properties": {
|
|
749
|
-
"GenerateSecretString": {},
|
|
750
|
-
},
|
|
751
|
-
"Type": "AWS::SecretsManager::Secret",
|
|
752
|
-
"UpdateReplacePolicy": "Delete",
|
|
753
|
-
},
|
|
754
766
|
"destinationtopicDCE2E0B8": {
|
|
755
767
|
"Properties": {
|
|
756
768
|
"KmsMasterKeyId": {
|
|
@@ -906,35 +918,33 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
906
918
|
},
|
|
907
919
|
"S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
|
|
908
920
|
},
|
|
909
|
-
"Description": "Updated at 1212-12-12T12:12:12.121Z",
|
|
910
921
|
"Environment": {
|
|
911
922
|
"Variables": {
|
|
912
|
-
"DD_API_KEY_SECRET_ARN":
|
|
913
|
-
"Ref": "datadogapikeysecret046FEF06",
|
|
914
|
-
},
|
|
923
|
+
"DD_API_KEY_SECRET_ARN": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME",
|
|
915
924
|
"DD_CAPTURE_LAMBDA_PAYLOAD": "false",
|
|
925
|
+
"DD_ENV": "production",
|
|
916
926
|
"DD_FLUSH_TO_LOG": "false",
|
|
917
927
|
"DD_LAMBDA_HANDLER": "index.handler",
|
|
918
928
|
"DD_LOGS_INJECTION": "false",
|
|
919
929
|
"DD_MERGE_XRAY_TRACES": "false",
|
|
920
930
|
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
921
931
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
932
|
+
"DD_SERVICE": "serviceName",
|
|
922
933
|
"DD_SITE": "datadoghq.com",
|
|
923
934
|
"DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "$.*",
|
|
924
935
|
"DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "$.*",
|
|
925
936
|
"DD_TRACE_ENABLED": "true",
|
|
937
|
+
"DD_VERSION": "local",
|
|
938
|
+
"DEPLOYMENT": "prod",
|
|
926
939
|
"DESTINATION_SNS_TOPIC_ARN": {
|
|
927
940
|
"Ref": "destinationtopicDCE2E0B8",
|
|
928
941
|
},
|
|
929
|
-
"ENVIRONMENT": "prod",
|
|
930
942
|
"NODE_ENV": "production",
|
|
931
943
|
"NODE_OPTIONS": "--enable-source-maps",
|
|
932
|
-
"SERVICE": "serviceName",
|
|
933
|
-
"VERSION": "local",
|
|
934
944
|
},
|
|
935
945
|
},
|
|
936
946
|
"FunctionName": "serviceName",
|
|
937
|
-
"Handler": "node_modules/datadog-lambda-js/
|
|
947
|
+
"Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler",
|
|
938
948
|
"KmsKeyArn": {
|
|
939
949
|
"Fn::GetAtt": [
|
|
940
950
|
"kmskey49FBC3B3",
|
|
@@ -942,6 +952,18 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
942
952
|
],
|
|
943
953
|
},
|
|
944
954
|
"Layers": [
|
|
955
|
+
{
|
|
956
|
+
"Fn::Join": [
|
|
957
|
+
"",
|
|
958
|
+
[
|
|
959
|
+
"arn:aws:lambda:",
|
|
960
|
+
{
|
|
961
|
+
"Ref": "AWS::Region",
|
|
962
|
+
},
|
|
963
|
+
":464622532012:layer:Datadog-Node22-x:x",
|
|
964
|
+
],
|
|
965
|
+
],
|
|
966
|
+
},
|
|
945
967
|
{
|
|
946
968
|
"Fn::Join": [
|
|
947
969
|
"",
|
|
@@ -955,6 +977,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
955
977
|
],
|
|
956
978
|
},
|
|
957
979
|
],
|
|
980
|
+
"MemorySize": 512,
|
|
958
981
|
"ReservedConcurrentExecutions": 20,
|
|
959
982
|
"Role": {
|
|
960
983
|
"Fn::GetAtt": [
|
|
@@ -1065,6 +1088,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
1065
1088
|
},
|
|
1066
1089
|
"workerAliasLiveSqsEventSourceappStackworkerqueue8281B9F443B0CF93": {
|
|
1067
1090
|
"Properties": {
|
|
1091
|
+
"BatchSize": 10,
|
|
1068
1092
|
"EventSourceArn": {
|
|
1069
1093
|
"Fn::GetAtt": [
|
|
1070
1094
|
"workerqueueA05CE5C6",
|
|
@@ -1092,6 +1116,12 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
1092
1116
|
],
|
|
1093
1117
|
],
|
|
1094
1118
|
},
|
|
1119
|
+
"FunctionResponseTypes": [
|
|
1120
|
+
"ReportBatchItemFailures",
|
|
1121
|
+
],
|
|
1122
|
+
"ScalingConfig": {
|
|
1123
|
+
"MaximumConcurrency": 19,
|
|
1124
|
+
},
|
|
1095
1125
|
"Tags": [
|
|
1096
1126
|
{
|
|
1097
1127
|
"Key": "aws-codedeploy-hooks",
|
|
@@ -1354,9 +1384,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
1354
1384
|
"secretsmanager:DescribeSecret",
|
|
1355
1385
|
],
|
|
1356
1386
|
"Effect": "Allow",
|
|
1357
|
-
"Resource":
|
|
1358
|
-
"Ref": "datadogapikeysecret046FEF06",
|
|
1359
|
-
},
|
|
1387
|
+
"Resource": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME-??????",
|
|
1360
1388
|
},
|
|
1361
1389
|
{
|
|
1362
1390
|
"Action": [
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import { App, aws_secretsmanager, aws_sns } from 'aws-cdk-lib';
|
|
2
2
|
import { Template } from 'aws-cdk-lib/assertions';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
jest.useFakeTimers({
|
|
7
|
-
legacyFakeTimers: false,
|
|
8
|
-
doNotFake: [
|
|
9
|
-
'nextTick',
|
|
10
|
-
'setInterval',
|
|
11
|
-
'clearInterval',
|
|
12
|
-
'setTimeout',
|
|
13
|
-
'clearTimeout',
|
|
14
|
-
],
|
|
15
|
-
now: new Date(currentDate),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const originalEnv = process.env.ENVIRONMENT;
|
|
4
|
+
const originalDeployment = process.env.DEPLOYMENT;
|
|
19
5
|
const originalVersion = process.env.VERSION;
|
|
20
6
|
|
|
21
7
|
afterAll(() => {
|
|
22
|
-
process.env.
|
|
8
|
+
process.env.DEPLOYMENT = originalDeployment;
|
|
23
9
|
process.env.VERSION = originalVersion;
|
|
24
10
|
});
|
|
25
11
|
|
|
@@ -29,8 +15,8 @@ afterEach(() => {
|
|
|
29
15
|
|
|
30
16
|
it.each(['dev', 'prod'])(
|
|
31
17
|
'returns expected CloudFormation stack for %s',
|
|
32
|
-
async (
|
|
33
|
-
process.env.
|
|
18
|
+
async (deployment) => {
|
|
19
|
+
process.env.DEPLOYMENT = deployment;
|
|
34
20
|
process.env.VERSION = 'local';
|
|
35
21
|
|
|
36
22
|
const { AppStack } = await import('./appStack.js');
|
|
@@ -69,10 +55,7 @@ it.each(['dev', 'prod'])(
|
|
|
69
55
|
/"DD_TAGS":"git.commit.sha:([0-9a-f]+),git.repository_url:([^\"]+)",/g,
|
|
70
56
|
'',
|
|
71
57
|
)
|
|
72
|
-
.replaceAll(
|
|
73
|
-
/(layer:Datadog-Extension-.+?:)\d+/g,
|
|
74
|
-
(_, layer) => `${layer}x`,
|
|
75
|
-
);
|
|
58
|
+
.replaceAll(/(layer:Datadog-[^-]+-.+?:)\d+/g, (_, layer) => `${layer}x`);
|
|
76
59
|
expect(JSON.parse(json)).toMatchSnapshot();
|
|
77
60
|
},
|
|
78
61
|
);
|
|
@@ -19,7 +19,10 @@ import { DatadogLambda } from 'datadog-cdk-constructs-v2';
|
|
|
19
19
|
import { config } from './config.js';
|
|
20
20
|
|
|
21
21
|
// Updated by https://github.com/seek-oss/rynovate
|
|
22
|
-
const DATADOG_EXTENSION_LAYER_VERSION =
|
|
22
|
+
const DATADOG_EXTENSION_LAYER_VERSION = 87;
|
|
23
|
+
|
|
24
|
+
// Updated by https://github.com/seek-oss/rynovate
|
|
25
|
+
const DATADOG_NODE_LAYER_VERSION = 126;
|
|
23
26
|
|
|
24
27
|
export class AppStack extends Stack {
|
|
25
28
|
constructor(scope: Construct, id: string, props?: StackProps) {
|
|
@@ -84,6 +87,7 @@ export class AppStack extends Stack {
|
|
|
84
87
|
const worker = new aws_lambda_nodejs.NodejsFunction(this, 'worker', {
|
|
85
88
|
architecture: aws_lambda.Architecture[architecture],
|
|
86
89
|
runtime: aws_lambda.Runtime.NODEJS_22_X,
|
|
90
|
+
memorySize: 512,
|
|
87
91
|
environmentEncryption: kmsKey,
|
|
88
92
|
// aws-sdk-v3 sets this to true by default, so it is not necessary to set the environment variable
|
|
89
93
|
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-reusing-connections.html
|
|
@@ -95,7 +99,6 @@ export class AppStack extends Stack {
|
|
|
95
99
|
target: 'node22',
|
|
96
100
|
// aws-sdk-v3 is set as an external module by default, but we want it to be bundled with the function
|
|
97
101
|
externalModules: [],
|
|
98
|
-
nodeModules: ['datadog-lambda-js', 'dd-trace'],
|
|
99
102
|
},
|
|
100
103
|
functionName: '<%- serviceName %>',
|
|
101
104
|
environment: {
|
|
@@ -111,10 +114,6 @@ export class AppStack extends Stack {
|
|
|
111
114
|
}
|
|
112
115
|
: {}),
|
|
113
116
|
},
|
|
114
|
-
// https://github.com/aws/aws-cdk/issues/28237
|
|
115
|
-
// This forces the lambda to be updated on every deployment
|
|
116
|
-
// If you do not wish to use hotswap, you can remove the new Date().toISOString() from the description
|
|
117
|
-
description: `Updated at ${new Date().toISOString()}`,
|
|
118
117
|
reservedConcurrentExecutions: config.workerLambda.reservedConcurrency,
|
|
119
118
|
});
|
|
120
119
|
|
|
@@ -127,11 +126,15 @@ export class AppStack extends Stack {
|
|
|
127
126
|
);
|
|
128
127
|
|
|
129
128
|
const datadog = new DatadogLambda(this, 'datadog', {
|
|
129
|
+
env: config.env,
|
|
130
|
+
service: config.service,
|
|
131
|
+
version: config.version,
|
|
132
|
+
|
|
130
133
|
apiKeySecret: datadogSecret,
|
|
131
|
-
addLayers: false,
|
|
132
134
|
enableDatadogLogs: false,
|
|
133
|
-
flushMetricsToLogs: false,
|
|
134
135
|
extensionLayerVersion: DATADOG_EXTENSION_LAYER_VERSION,
|
|
136
|
+
flushMetricsToLogs: false,
|
|
137
|
+
nodeLayerVersion: DATADOG_NODE_LAYER_VERSION,
|
|
135
138
|
});
|
|
136
139
|
|
|
137
140
|
datadog.addLambdaFunctions([worker]);
|
|
@@ -141,7 +144,11 @@ export class AppStack extends Stack {
|
|
|
141
144
|
});
|
|
142
145
|
|
|
143
146
|
workerDeployment.alias.addEventSource(
|
|
144
|
-
new aws_lambda_event_sources.SqsEventSource(queue
|
|
147
|
+
new aws_lambda_event_sources.SqsEventSource(queue, {
|
|
148
|
+
batchSize: config.workerLambda.batchSize,
|
|
149
|
+
maxConcurrency: config.workerLambda.reservedConcurrency - 1, // Ensure we have capacity reserved for our blue/green deployment
|
|
150
|
+
reportBatchItemFailures: true,
|
|
151
|
+
}),
|
|
145
152
|
);
|
|
146
153
|
}
|
|
147
154
|
}
|
|
@@ -1,52 +1,66 @@
|
|
|
1
1
|
import { Env } from 'skuba-dive';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type Deployment = (typeof deployments)[number];
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const deployments = ['dev', 'prod'] as const;
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const deployment = Env.oneOf(deployments)('DEPLOYMENT');
|
|
8
8
|
|
|
9
9
|
interface Config {
|
|
10
|
-
|
|
10
|
+
env: 'development' | 'production';
|
|
11
|
+
service: string;
|
|
12
|
+
version: string;
|
|
13
|
+
|
|
11
14
|
workerLambda: {
|
|
15
|
+
batchSize: number;
|
|
12
16
|
reservedConcurrency: number;
|
|
13
17
|
environment: {
|
|
14
|
-
|
|
15
|
-
SERVICE: string;
|
|
16
|
-
VERSION: string;
|
|
18
|
+
DEPLOYMENT: Deployment;
|
|
17
19
|
};
|
|
18
20
|
};
|
|
21
|
+
|
|
19
22
|
datadogApiKeySecretArn: string;
|
|
20
23
|
sourceSnsTopicArn: string;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
|
-
const
|
|
26
|
+
const service = '<%- serviceName %>';
|
|
27
|
+
const version = Env.string('VERSION');
|
|
28
|
+
|
|
29
|
+
const configs: Record<Deployment, Config> = {
|
|
24
30
|
dev: {
|
|
25
|
-
|
|
31
|
+
env: 'development',
|
|
32
|
+
service,
|
|
33
|
+
version,
|
|
34
|
+
|
|
26
35
|
workerLambda: {
|
|
27
|
-
|
|
36
|
+
batchSize: 10,
|
|
37
|
+
reservedConcurrency: 3,
|
|
28
38
|
environment: {
|
|
29
|
-
|
|
30
|
-
SERVICE: '<%- serviceName %>',
|
|
31
|
-
VERSION: Env.string('VERSION', { default: 'local' }),
|
|
39
|
+
DEPLOYMENT: 'dev',
|
|
32
40
|
},
|
|
33
41
|
},
|
|
34
|
-
|
|
42
|
+
|
|
43
|
+
datadogApiKeySecretArn:
|
|
44
|
+
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
|
|
35
45
|
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
|
|
36
46
|
},
|
|
37
47
|
prod: {
|
|
38
|
-
|
|
48
|
+
env: 'production',
|
|
49
|
+
service,
|
|
50
|
+
version,
|
|
51
|
+
|
|
39
52
|
workerLambda: {
|
|
53
|
+
batchSize: 10,
|
|
40
54
|
reservedConcurrency: 20,
|
|
41
55
|
environment: {
|
|
42
|
-
|
|
43
|
-
SERVICE: '<%- serviceName %>',
|
|
44
|
-
VERSION: Env.string('VERSION', { default: 'local' }),
|
|
56
|
+
DEPLOYMENT: 'prod',
|
|
45
57
|
},
|
|
46
58
|
},
|
|
47
|
-
|
|
59
|
+
|
|
60
|
+
datadogApiKeySecretArn:
|
|
61
|
+
'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
|
|
48
62
|
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
|
|
49
63
|
},
|
|
50
64
|
};
|
|
51
65
|
|
|
52
|
-
export const config: Config = configs[
|
|
66
|
+
export const config: Config = configs[deployment];
|
|
@@ -7,7 +7,7 @@ import { config } from './config.js';
|
|
|
7
7
|
const app = new App();
|
|
8
8
|
|
|
9
9
|
const appStack = new AppStack(app, 'appStack', {
|
|
10
|
-
stackName: config.
|
|
10
|
+
stackName: config.service,
|
|
11
11
|
tags: {
|
|
12
12
|
'seek:source:url': 'https://github.com/SEEK-Jobs/<%- repoName %>',
|
|
13
13
|
// 'seek:system:name': 'TODO: https://rfc.skinfra.xyz/RFC051-AWS-Tagging-Standard.html#tagging-schema',
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"deploy": "cdk deploy appStack --require-approval never",
|
|
13
|
-
"deploy:hotswap": "pnpm --silent run deploy --hotswap",
|
|
14
|
-
"deploy:watch": "pnpm --silent deploy:hotswap --watch",
|
|
15
13
|
"format": "skuba format",
|
|
16
14
|
"lint": "skuba lint",
|
|
17
15
|
"start": "skuba start --port <%- port %>",
|
|
@@ -24,11 +22,9 @@
|
|
|
24
22
|
"@aws-sdk/client-lambda": "^3.363.0",
|
|
25
23
|
"@aws-sdk/client-sns": "^3.363.0",
|
|
26
24
|
"@seek/aws-codedeploy-hooks": "^2.0.0",
|
|
27
|
-
"@seek/logger": "^
|
|
28
|
-
"datadog-lambda-js": "^10.0.0",
|
|
29
|
-
"dd-trace": "^5.0.0",
|
|
25
|
+
"@seek/logger": "^11.1.0",
|
|
30
26
|
"skuba-dive": "^2.0.0",
|
|
31
|
-
"zod": "^
|
|
27
|
+
"zod": "^4.0.0"
|
|
32
28
|
},
|
|
33
29
|
"devDependencies": {
|
|
34
30
|
"@seek/aws-codedeploy-infra": "^3.0.0",
|
|
@@ -41,11 +37,13 @@
|
|
|
41
37
|
"aws-sdk-client-mock-jest": "^4.0.0",
|
|
42
38
|
"chance": "^1.1.8",
|
|
43
39
|
"constructs": "^10.0.17",
|
|
44
|
-
"datadog-cdk-constructs-v2": "^
|
|
40
|
+
"datadog-cdk-constructs-v2": "^3.0.0",
|
|
41
|
+
"datadog-lambda-js": "^12.0.0",
|
|
42
|
+
"dd-trace": "^5.0.0",
|
|
45
43
|
"pino-pretty": "^13.0.0",
|
|
46
|
-
"skuba": "13.0.0-subpath-imports-
|
|
44
|
+
"skuba": "13.0.0-subpath-imports-20251003044159"
|
|
47
45
|
},
|
|
48
|
-
"packageManager": "pnpm@10.
|
|
46
|
+
"packageManager": "pnpm@10.17.1",
|
|
49
47
|
"engines": {
|
|
50
48
|
"node": ">=22"
|
|
51
49
|
}
|