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

Add accessKeyId and secretAccessKey to S3 Client init to remove aws configure dependency #33

Merged
merged 1 commit into from
Jul 19, 2018

Conversation

nschirmer
Copy link
Contributor

Forgive me if this seems unnecessary, but I noticed that createBucket fails if you do not have a local ~/.aws/configuration file on your machine, even though this fake S3 server doesn't care about access/secret keys. Output will say Serverless: creating bucket: bucket-name but it won't actually be created and any errors will be suppressed.

In order to bypass this requirement, we can simply pass in dummy text for accessKeyId and secretAccessKey when initializing the S3 client.

I also updated the getClient method to use the options.host value instead of hardcoded localhost.

@ar90n
Copy link
Owner

ar90n commented Jul 19, 2018

Hi @nschirmer
Thanks for your great PR. I ididn't know what you said. I merged your PR and published new version. Please try it !!

@nschirmer
Copy link
Contributor Author

Yes, thank you @ar90n, I've confirmed that new bucket creation works now!

In case you did not understand the issue, if you were to remove your ~/.aws/configuration file (so when you try to run any aws command over CLI, it gives you an error saying configuration needs to be made), and then boot up serverless with a new bucket name, the bucket would not actually show up in your /tmp folder!

Now, with manually passing the access keys, it will.

Thank you!

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.

None yet

2 participants