Creating Global Environment Variables
Global environment variables are varible that is accessible globally. Usually it's declared in file with name .env.
# PostgreSQL
PGHOST="Your DB IP address"
PGPASSWORD="Your DB password"
PGDATABASE="You DB name"
PGUSER="Your DB username"
# CSV files on S3 bucket
S3_LOG_BUCKET_URI="s3://<Bucket name>/<Folder name>"
S3_LOG_CONFIG_FILE="/var/task/prd_s3.cfg"
S3_LOG_FOLDER="/tmp/store"
# Logging file to upload into S3 bucket
LAMBDA_FOLDER="/tmp/log"
LAMBDA_FILE="export_logs.log"
# Connection
TIMEZONE="<Your timezone>"
MAX_CONCURRENT_REQUESTS=10
SERVER_ID_LIMIT=5
AFTER_FAILED_IGNORING_MINUTES=10
PostgreSQL DB Variables
Make sure you have already set up AWS Lambda function to the RDS permission with IAM.
-
PGHOST
- PostgreSQL RDS host IP address. -
PGPASSWORD
- PostgreSQL RDS database password. -
PGDATABASE
- PostgreSQL RDS database name. -
PGUSER
- PostgreSQL RDS database username.
CSV Files on S3 Bucket Variables
Make sure you have already set up AWS Lambda function to the AWS S3 permission with IAM.
-
S3_LOG_BUCKET_URI
- The S3 bucket's URI. -
S3_LOG_CONFIG_FILE
- The credential configuration file. -
S3_LOG_FOLDER
- The folder where the downloaded CSV files will be stored.
Connection Variables
-
TIMEZONE
- Your local timezone. -
MAX_CONCURRENT_REQUESTS
- Maximum concurrent request for PostgreSQL connection. -
SERVER_ID_LIMIT
- Server limited count. -
AFTER_FAILED_IGNORING_MINUTES
- When invocation failed, how long the lock will be ignored in minutes.