Unable to set aws credentials in v3.2.0
See original GitHub issueconst 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.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Setting Credentials in Node.js - AWS SDK for JavaScript
Credentials that are explicitly set through the service-client constructor. Environment variables. The shared credentials file. Credentials loaded from the ECS ...
Read more >Issues - GitHub
aws /credentials that refers to a role_arn and another source_profile, v3 of the SDK fails to assume the role where-as v2 of the...
Read more >How to set credentials in AWS SDK v3 JavaScript?
I was trying to dig up my code that I have. I'll post it to see where I'm going wrong. · 1. Also,...
Read more >How to fix the profile support in the AWS JS SDK v3
Two months ago, AWS released the v3 of the Javascript SDK. ... For example, this is a set of credentials configured for the...
Read more >Setup AWS credentials and configuration
If you used option 2 or option 3 then you have put your credentials into files that will be used by the AWS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have been able to circumvent this by specifying the
CloudWatchLogsClientConfig
directly thoughawsOptions
Done https://github.com/lazywithclass/winston-cloudwatch/blob/master/README.md#credentials
Thanks for the help everyone, it’s much appreciated!