fix LocationConstraint added for us-east-1 by the SDK#214
Merged
Conversation
actually use the patch
6b43f85 to
ae98669
Compare
joe4dev
approved these changes
Mar 23, 2023
Member
There was a problem hiding this comment.
LGTM 🚀
✅ I tested it against LocalStack on macOS and can confirm it fixes the location constraint issue.
(there are still other issues with the demo app such as a ClassDefNotFoundException in the stepfunctions jar)
I guess it should not affect deployment against AWS but a quick test might be helpful.
| { | ||
| "name": "serverless-localstack", | ||
| "version": "1.0.4", | ||
| "version": "1.0.5", |
| // copy params so that appending keys does not unintentioinallly | ||
| // mutate params object argument passed in by user | ||
| var copiedParams = AWS.util.copy(params); | ||
| if (this.config.region !== 'us-east-1' && !params.CreateBucketConfiguration) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a patch to the
aws-sdk, using its own utilities to overwrite an S3 method.It fixes localstack/localstack-demo#52
In
aws-sdk/lib/services/s3.js, there this createBucket method:However, the
if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration)check to add theLocationConstraintevaluate the endpoint (to see if it's a region specific one) against the global endpoint forus-east-1.This patch changes the logic to simply check the region set in the config, and if different than
us-east-1and a configuration is not set, sets it.I can now properly deploy the demo with the new S3 v2 provider which enforces the specific fact that you cannot set the
LocationConstrainttous-east-1.To reproduce, you can deploy https://github.com/localstack/localstack-demo/ with and without the fix, with
PROVIDER_OVERRIDE_S3=v2when starting LocalStack.I however have no idea how to add a test for this.