email plus return item statuses

This commit is contained in:
jackiettran
2025-10-06 15:41:48 -04:00
parent 67cc997ddc
commit 5c3d505988
28 changed files with 5861 additions and 259 deletions

36
backend/config/aws.js Normal file
View File

@@ -0,0 +1,36 @@
const { fromIni } = require("@aws-sdk/credential-providers");
/**
* Get AWS configuration based on environment
* - Development: Uses AWS credential profiles from ~/.aws/credentials
* - Production: Uses IAM roles (EC2/Lambda/ECS instance roles)
*/
function getAWSCredentials() {
if (process.env.NODE_ENV === "dev") {
// Local development: use profile from ~/.aws/credentials
const profile = process.env.AWS_PROFILE;
return fromIni({ profile });
}
}
/**
* Get complete AWS client configuration
*/
function getAWSConfig() {
const config = {
region: process.env.AWS_REGION || "us-east-1",
};
const credentials = getAWSCredentials();
if (credentials) {
config.credentials = credentials;
}
return config;
}
module.exports = {
getAWSConfig,
getAWSCredentials,
};