-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add version variable to cdk template logger #1548
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
dc4af2b
Add version variable to cdk template logger
GeordieEK c54e0f1
Merge branch 'main' into use-version-cdk-template
GeordieEK e9fe891
Update slow-seahorses-talk.md
GeordieEK 716b12f
De-couple infra and config runtime
GeordieEK 6fd643b
Merge branch 'use-version-cdk-template' of https://github.com/Geordie…
GeordieEK 575c890
fix import
GeordieEK 99fbe54
lint & format
GeordieEK 06f9ad9
Update config to match main
GeordieEK 18bfce9
update logger to match newer format as seen in sqs-worker logging
GeordieEK b4b7d46
Fix infra Config exporting as any
GeordieEK a21ee15
fix config import
GeordieEK 3bc8105
re-organise imports
GeordieEK a18f041
fix issues
samchungy ff41b6b
Update .changeset/slow-seahorses-talk.md
GeordieEK 3dc9395
Add pino-pretty dev dep
GeordieEK 278e1df
Add SERVICE & VERSION to config
GeordieEK dc42c4e
Remove version
GeordieEK 160c744
use CI version and service in cdk infra config
GeordieEK 88767d9
Apply suggestions from code review
samchungy 768daf0
Merge branch 'main' into use-version-cdk-template
samchungy e464bc1
Update slow-seahorses-talk.md
samchungy d86dd71
Remove type exports
samchungy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: Add worker config file |
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
"@aws-sdk/client-lambda": "^3.363.0", | ||
"@aws-sdk/client-sns": "^3.363.0", | ||
"@seek/logger": "^6.0.0", | ||
"skuba-dive": "^2.0.0", | ||
"zod": "^3.19.1" | ||
}, | ||
"devDependencies": { | ||
|
@@ -24,6 +25,7 @@ | |
"aws-cdk": "^2.109.0", | ||
"aws-cdk-lib": "^2.109.0", | ||
"constructs": "^10.0.17", | ||
"pino-pretty": "^11.0.0", | ||
"skuba": "*" | ||
}, | ||
"packageManager": "[email protected]", | ||
|
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,51 @@ | ||
import { Env } from 'skuba-dive'; | ||
|
||
interface Config { | ||
environment: Environment; | ||
|
||
logLevel: string; | ||
name: string; | ||
version: string; | ||
} | ||
|
||
type Environment = (typeof environments)[number]; | ||
|
||
const dev = 'dev'; | ||
const prod = 'prod'; | ||
|
||
const environments = ['local', 'test', dev, prod] as const; | ||
|
||
const environment = Env.oneOf(environments)('ENVIRONMENT'); | ||
|
||
/* istanbul ignore next: config verification makes more sense in a smoke test */ | ||
const configs: Record<Environment, () => Omit<Config, 'environment'>> = { | ||
local: () => ({ | ||
logLevel: 'debug', | ||
name: '<%- serviceName %>', | ||
version: 'local', | ||
}), | ||
|
||
test: () => ({ | ||
...configs.local(), | ||
|
||
logLevel: Env.string('LOG_LEVEL', { default: 'silent' }), | ||
version: 'test', | ||
}), | ||
|
||
[dev]: () => ({ | ||
...configs[prod](), | ||
|
||
logLevel: 'debug', | ||
}), | ||
|
||
[prod]: () => ({ | ||
logLevel: 'info', | ||
name: Env.string('SERVICE'), | ||
samchungy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version: Env.string('VERSION'), | ||
}), | ||
}; | ||
|
||
export const config: Config = { | ||
...configs[environment](), | ||
environment, | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to declare
pino-pretty
as a dev dep?