Closed
Description
const logger = winston.createLogger({
transports: [
new WinstonCloudWatch({
name: `/my-log/${stage}`,
logGroupName: `/aws/s3/${repoName}`,
logStreamName: 'log-stream',
awsRegion: 'ap-northeast-2',
awsAccessKeyId: stage === 'prod' ? process.env.PROD_ACCESS_KEY_ID : process.env.DEV_ACCESS_KEY_ID,
awsSecretKey: stage === 'prod' ? process.env.PROD_SECRET_ACCESS_KEY : process.env.DEV_SECRET_ACCESS_KEY
})
]
})
In winston-cloudwatch v3.1.1 with aws-sdk v2 you could set the awsAccessKeyId
, awsSecretKey
options.
However, in winston-cloudwatch v3.2.0 using aws-sdk v3, even setting the awsAccessKeyId
and awsSecretKey
options causes the credentials error as shown below.
You're probably looking at the credentials set in your .aws/credentials
file.
I want to be able to set the awsAccessKeyId
and awsSecretKey
in the winston-cloudwatch option, without the .aws/credentials
file.