Skip to content

Ses s3 initmodules#213

Open
chnnick wants to merge 3 commits into
mainfrom
ses-s3-initmodules
Open

Ses s3 initmodules#213
chnnick wants to merge 3 commits into
mainfrom
ses-s3-initmodules

Conversation

@chnnick

@chnnick chnnick commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Issue

Part of #140 using module initialization errors instead of having checks for environment variables happen in the services.

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

Briefly list the changes made to the code:

  1. Made SES and S3 modules implement the onmoduleinit class
  2. Hardcoded in the env variables that SES and S3 previously checked for within the service (S3) or factory (SES) checked on module initialization
  3. if env variables are missing (and in ses case, the send_automated_emails env variable is set to true), throws error/fails startup

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.

Provide screenshots of any new components, styling changes, or pages.
Screenshot 2026-07-22 at 12 53 29 AM

Screenshot 2026-07-22 at 12 53 20 AM Screenshot 2026-07-22 at 12 53 57 AM

🏕️ (Optional) Future Work / Notes

  • [!IMPORTANT] I am not sure if these are the same, but S3 uses AWS_ACCESS_KEY, and AWS_SECRET_KEY as values, but SES uses AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Should these be normalized???
  • Cognito PR has a shared utils/env.ts file (can be renamed) that can be used instead of the existing check:
if (!value || value.trim().length === 0) {
        throw new Error(`Missing required environment variable: ${name}`);
      }
    }
  • Added module tests for these modules since they are supposed to fail/throw errors instead of just warn like Cognito's, but I dont know of any other modules that use module tests so can delete if unneccessary

@chnnick
chnnick requested a review from maxn990 as a code owner July 22, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant