This application uses AWS Secrets Manager to securely store AWS credentials instead of hardcoding them.
Create a secret with the following JSON structure:
{
"accessKeyId": "YOUR_AWS_ACCESS_KEY_ID",
"secretAccessKey": "YOUR_AWS_SECRET_ACCESS_KEY",
"region": "us-east-1"
}Default secret name: ngo-app/aws-credentials
Set the following environment variables:
| Variable | Description | Default |
|---|---|---|
AWS_REGION |
AWS region for Secrets Manager | us-east-1 |
AWS_SECRET_NAME |
Name of the secret in Secrets Manager | ngo-app/aws-credentials |
The application needs permissions to access Secrets Manager. Ensure your IAM role/user has:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue"
],
"Resource": "arn:aws:secretsmanager:us-east-1:YOUR_ACCOUNT_ID:secret:ngo-app/aws-credentials*"
}
]
}For local development, ensure AWS credentials are configured via:
- Environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) - AWS credentials file (
~/.aws/credentials) - IAM role (when running on EC2/ECS/Lambda)
npm install
npm start