refactor(Lambda): make use of Parameter Store#1849
Merged
simonknittel merged 1 commit intodevelopfrom Dec 7, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Terraform Plan 📖
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Lambda functions to use AWS Systems Manager Parameter Store for secret management instead of hardcoded environment variables. The changes centralize secret management through a new parameter fetching utility and eliminate local development server code.
- Migrated sensitive credentials from environment variables to AWS Parameter Store
- Introduced a common parameter fetching utility for Lambda functions
- Restructured Lambda function file organization by moving handlers to the top level
- Removed local development API server and related dependencies
Reviewed changes
Copilot reviewed 49 out of 66 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| terraform/variables.tf | Removed email function parameters variable |
| terraform/scrape-discord-events-function.tf | Added Parameter Store references and runtime specification |
| terraform/notification-router.tf | Added Parameter Store references for web push keys |
| terraform/modules/scheduled-lambda/variables.tf | Added runtime and parameters variables |
| terraform/modules/scheduled-lambda/iam.tf | Added IAM policy for Parameter Store access |
| terraform/modules/scheduled-lambda/function.tf | Made runtime configurable and added Parameter Store extension layer |
| terraform/modules/eventbridge-sqs-lambda/variables.tf | Changed parameters from object list to string list |
| terraform/modules/eventbridge-sqs-lambda/iam.tf | Refactored IAM policies and removed custom SSM parameter resources |
| terraform/modules/eventbridge-sqs-lambda/function.tf | Updated Parameter Store extension layer version and standardized environment variables |
| terraform/midnight-automations.tf | Added runtime and parameter references |
| terraform/email-function.tf | Simplified parameter references |
| pnpm-monorepo/apps/lambda/src/scrape-discord-events/setup.ts | Added parameter fetching setup for Discord events function |
| pnpm-monorepo/apps/lambda/src/scrape-discord-events/eventbridge.ts | Updated import paths and switched to process.env |
| pnpm-monorepo/apps/lambda/src/scrape-discord-events/discord/utils/getEvents.ts | Switched from env object to process.env |
| pnpm-monorepo/apps/lambda/src/scrape-discord-events/discord/utils/getEventUsers.ts | Updated import paths and switched to process.env |
| pnpm-monorepo/apps/lambda/src/scrape-discord-events/discord/utils/checkResponseForError.ts | Translated error messages to English and switched to process.env |
| pnpm-monorepo/apps/lambda/src/scrape-discord-events.ts | New top-level handler file with setup import |
| pnpm-monorepo/apps/lambda/src/notification-router/web-push.ts | Updated import paths and switched to process.env for VAPID setup |
| pnpm-monorepo/apps/lambda/src/notification-router/type-handlers/WebPushSubscribed.ts | Updated import paths and switched to process.env |
| pnpm-monorepo/apps/lambda/src/notification-router/type-handlers/ProfitDistributionPayoutDisbursed.ts | Updated import paths |
| pnpm-monorepo/apps/lambda/src/notification-router/setup.ts | Added parameter fetching setup for notification router |
| pnpm-monorepo/apps/lambda/src/notification-router/handler.ts | Removed env import |
| pnpm-monorepo/apps/lambda/src/notification-router.ts | Added setup import and fixed formatting |
| pnpm-monorepo/apps/lambda/src/midnight-automations/* | Updated import paths across all automation files |
| pnpm-monorepo/apps/lambda/src/midnight-automations/setup.ts | Added parameter fetching setup for midnight automations |
| pnpm-monorepo/apps/lambda/src/midnight-automations.ts | New top-level handler file with setup import |
| pnpm-monorepo/apps/lambda/src/local-api.ts | Removed local development API server |
| pnpm-monorepo/apps/lambda/src/functions/* | Removed old function files and env validation |
| pnpm-monorepo/apps/lambda/src/common/parameters.ts | Added new parameter fetching utility |
| pnpm-monorepo/apps/lambda/scripts/build.sh | Updated build paths to look for functions at src root |
| pnpm-monorepo/apps/lambda/package.json | Removed local development dependencies |
| pnpm-monorepo/apps/lambda/.env.example | Renamed DISCORD_TOKEN to DISCORD_BOT_TOKEN |
| docs/setup-test-and-production.md | Updated setup instructions to remove email function parameters |
| bun-packages/packages/email-function/src/index.ts | Updated parameter path reference |
| .github/workflows/terraform-plan.yml | Changed environment secrets to variables |
| .github/workflows/terraform-apply.yml | Changed environment secrets to variables |
1549b76 to
f9f66f4
Compare
f9f66f4 to
3706e3c
Compare
|
pnpm-monorepo/apps/lambda/src/notification-router/type-handlers/WebPushSubscribed.ts
Show resolved
Hide resolved
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



No description provided.