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

Maintenance: Update AWS SDK to v3, limit to only S3 client #2785

Merged
merged 3 commits into from Mar 19, 2020

Conversation

kevinrobinson
Copy link
Contributor

@kevinrobinson kevinrobinson commented Mar 19, 2020

On top of #2784.

This is from a deprecation warning via email, and from looking at https://github.com/aws/aws-sdk-ruby/blob/master/V3_UPGRADING_GUIDE.md No impact expected, other than that we can now pull in only the S3 client and not the rest of the AWS SDK. So incidentally this should also reduce the slug size.

EDIT: turns out that there's a change in how credentials are read across versions, and the S3 client checks that config is present in the constructor. Some tests use the real client, and then mock calls to it, but those now fail since the constructor raises that there is no config.

In development, this SDK behavior is a bit dangerous and not what we want. If if there was local config or credentials in ~/.aws the SDK would read that from disk, which is why these tests didn't fail when run locally. It's dangerous because it's possible that test bugs could lead to exercising stale credentials a developer left on disk from doing unrelated work on the AWS CLI (even for a different project). We never want this to be possible, so this adds AWS_SDK_CONFIG_OPT_OUT.

It also adds fake values to the ENV for keys and secrets in dev and test, so that the constructor doesn't raise and we can mock and test. It looks like the SDK may now have more first-class ways to stub it that are baked in (eg https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/ClientStubs.html) but this PR didn't look more deeply into that.

@kevinrobinson
Copy link
Contributor Author

kevinrobinson commented Mar 19, 2020

selfie

@kevinrobinson kevinrobinson merged commit 0032d41 into master Mar 19, 2020
1 check passed
@kevinrobinson kevinrobinson deleted the upgrade/aws-sdk-s3 branch Mar 19, 2020
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

1 participant