Skip to content

Ses s3 initmodules - #213

Merged
chnnick merged 20 commits into
mainfrom
ses-s3-initmodules
Sep 5, 2026
Merged

Ses s3 initmodules#213
chnnick merged 20 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

@maxn990 maxn990 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, one quick thing then feel free to merge! thanks!

Comment thread apps/backend/src/aws/ses/awsSesClient.factory.ts Outdated
@chnnick
chnnick requested a review from dburkhart07 August 17, 2026 23:56

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few things i think would be good to clear up now that we are doing this. thanks in advance!

Comment thread apps/backend/src/aws/s3/aws-s3.module.ts Outdated
Comment thread apps/backend/src/aws/ses/email.module.ts Outdated
Comment thread apps/backend/src/aws/ses/awsSesClient.factory.ts Outdated
Comment thread apps/backend/src/aws/s3/aws-s3.service.ts
@chnnick
chnnick requested a review from dburkhart07 August 25, 2026 05:11

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few more small things :D

Comment thread apps/backend/src/aws/ses/email.module.ts Outdated
Comment thread apps/backend/src/aws/s3/aws-s3.module.ts Outdated
Comment thread apps/backend/src/aws/s3/aws-s3.module.ts Outdated
Comment thread apps/backend/src/aws/s3/aws-s3.service.ts Outdated
@chnnick
chnnick requested a review from dburkhart07 September 3, 2026 04:38

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small nit, aside from that looks awesome

Comment thread apps/backend/src/aws/s3/aws-s3.module.ts Outdated
@chnnick
chnnick merged commit 173d090 into main Sep 5, 2026
4 checks passed
@chnnick
chnnick deleted the ses-s3-initmodules branch September 5, 2026 05:43
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.

3 participants