I have used aws sns for message service. I have used dot env for storing credentials for aws-sdk. App is working fine in localhost but when i deploy my node app to AWS EC2 following error occurs: Error [CredentialsError]: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1 app.js
const dotenv = require("dotenv");
dotenv.config();
const AWS = require("aws-sdk");
AWS.config.update({
accessKeyId: process.env.ID,
secretAccessKey: process.env.KEY,
region: process.env.REGION,
});