trek10inc / serverless-secrets

An opinionated tool for safely managing and deploying Serverless projects and their secrets.
Other
165 stars 27 forks source link

Add the option to add HTTP PROXY when communicating with AWS #21

Open williamsia opened 6 years ago

williamsia commented 6 years ago

This is to address network connectivity issue when communicating with AWS when working behind corporate proxy.

azurelogic commented 6 years ago

Hey @williamsia, Thanks for the PR! I get what you're after here, but let me take this back to the drawing board and see what I can do in terms of offering something more flexible. I'm sure others may need access to the AWS.config object for other uses, and I don't think it is sustainable to do this kind of thing for every provider long term. I'm thinking of another client method that lets you send a "configuration callback" to be executed before the provider is retrieved, and the AWS.config would be passed in as an argument for the consumer to tweak as needed. Thoughts?

williamsia commented 6 years ago

Hi @azurelogic thanks for the quick reply. Maybe we should have just the provider specified by the serverless framework itself, https://github.com/serverless/serverless/blob/master/lib/plugins/aws/provider/awsProvider.js#L114 so we don't have to reinvent the wheel. We just piggy backing all the AWS options set back the serverless framework itself.

And just uses the provider the way "sls invoke" uses it as specified in https://github.com/serverless/serverless/blob/master/lib/plugins/aws/invoke/index.js#L82

But that means more changes on the code. I don't mind doing some of the work if you agree with this approach, either way happy to follow your lead mate.

Cheers