Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: skuba <34733141+seek-oss-ci@users.noreply.github.com>
- Loading branch information
1 parent
af29e3a
commit aa9a11d
Showing
8 changed files
with
74 additions
and
81 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'skuba': patch | ||
--- | ||
|
||
template/lambda-sqs-worker-cdk: Replace CDK context based config with TypeScript config |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { z } from 'zod'; | ||
|
||
const environment = z.enum(['dev', 'prod']).parse(process.env.ENVIRONMENT); | ||
|
||
type Environment = typeof environment; | ||
|
||
export interface Config { | ||
appName: string; | ||
workerLambda: { | ||
reservedConcurrency: number; | ||
environment: { | ||
ENVIRONMENT: Environment; | ||
}; | ||
}; | ||
sourceSnsTopicArn: string; | ||
} | ||
|
||
export const configs: Record<Environment, Config> = { | ||
dev: { | ||
appName: '<%- serviceName %>', | ||
workerLambda: { | ||
reservedConcurrency: 2, | ||
environment: { | ||
ENVIRONMENT: 'dev', | ||
}, | ||
}, | ||
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn', | ||
}, | ||
prod: { | ||
appName: '<%- serviceName %>', | ||
workerLambda: { | ||
reservedConcurrency: 20, | ||
environment: { | ||
ENVIRONMENT: 'prod', | ||
}, | ||
}, | ||
sourceSnsTopicArn: 'TODO: sourceSnsTopicArn', | ||
}, | ||
}; | ||
|
||
export const config = configs[environment]; |
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,14 +1,11 @@ | ||
import { App } from 'aws-cdk-lib'; | ||
|
||
import { GlobalContextSchema } from '../shared/context-types'; | ||
|
||
import { AppStack } from './appStack'; | ||
import { config } from './config'; | ||
|
||
const app = new App(); | ||
|
||
const context = GlobalContextSchema.parse(app.node.tryGetContext('global')); | ||
|
||
// eslint-disable-next-line no-new | ||
new AppStack(app, 'appStack', { | ||
stackName: context.appName, | ||
stackName: config.appName, | ||
}); |
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
This file was deleted.
Oops, something went wrong.