Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use modular cloudwatch package instead of entire aws sdk. #172

Merged
merged 2 commits into from
Mar 16, 2022

Conversation

peakyDicers
Copy link
Contributor

@peakyDicers peakyDicers commented Jan 9, 2022

I wanted to use aws' new modular packages instead of the full aws sdk.

I made it so that the user only needs to have the @aws-sdk/client-cloudwatch-logs module. To do this, I had to remove the proxy option which uses the main AWS sdk. In my opinion, this project shouldn't need to touch that option anyway. I also update mocha to fix the audit issues.

Lastly, I updated the typescript definition. name for transport options is optional.

@lazywithclass
Copy link
Owner

First of all thanls for this! I will review as soon as I can, I have close to zero time now but your effort means a lot to me.
Are you using your changes in production / staging environment?

@peakyDicers
Copy link
Contributor Author

First of all thanls for this! I will review as soon as I can, I have close to zero time now but your effort means a lot to me. Are you using your changes in production / staging environment?

It's my pleasure, and no worries! Yes, I'm currently using it in a staging environment. It seems to work, but I've only used it very lightly for a half hour or so.

I saw somebody post an issue addressing this same issue and their solution as well, they mentioned that there was a change from error.code to error.name in the aws sdk which I haven't fixed in this PR.

@lazywithclass
Copy link
Owner

Can you reference that issue here please?

@peakyDicers
Copy link
Contributor Author

Yes, here it is: #160 (comment)

@sdesalas
Copy link

+1

@hectorgabucio
Copy link

Im using @peakyDicers solution and it works. Im using it on staging and production environment, and I didnt encounter problems so far.

@lazywithclass lazywithclass merged commit e705a18 into lazywithclass:master Mar 16, 2022
@lazywithclass
Copy link
Owner

Thanks for the feedback and the effort! Sorry for being so late I am swamped with work and uni study.

winston-cloudwatch@3.2.0 is out.

@tkdave
Copy link

tkdave commented May 20, 2022

Heads up. This PR broke the ability to set aws credentials in CloudwatchTransportOptions.
#181

3.1.1 is the last working version.

@lazywithclass
Copy link
Owner

Thanks @tkdave; if you have a solution for this issue feel free to send a PR, otherwise I will see if I can have a look in the next days, as it is a long standing issue.

lazywithclass pushed a commit that referenced this pull request Jul 17, 2023
proxy-agent was made redundant after #172, which introduced v3 of
aws-sdk. This meant that any proxy-related config was done on the
`AWS.CloudwatchLogs` instance, rather than on `WinstonCloudwatch`

Removing this dependency avoids a critical vulnerability with vm2,
inherited via proxy-agent and its dependencies.

Fixes #218
Supersedes #216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants