Skip to content

Conversation

skotambkar
Copy link
Contributor

@skotambkar skotambkar commented Jan 8, 2021

  • Code generates a custom deserializer for s3: get-bucket-location api operation. This implementation differs from how v1 sdk handles custom deserialization. V1 uses regex matching on response. In this change, we make use of already generated deserializer functions.

  • Adds unit test to validate the change.

  • Fixes LocationRestraint always empty on GetBucketLocation call #908

@skotambkar skotambkar requested review from skmcgrail and jasdel January 8, 2021 01:44
@skotambkar skotambkar requested a review from jasdel January 11, 2021 20:12
@Chandrian
Copy link

probably related, but just in case, putting it here. To work around this issue, I was trying to use HeadBucket and get the value of the "X-Amz-Bucket-Region" header, but getting the following error message:

failed to call service: S3, operation: HeadBucket, error: https response error StatusCode: 301, RequestID: xxx, HostID: xxx, api error MovedPermanently: Moved Permanently

@jasdel
Copy link
Contributor

jasdel commented Jan 13, 2021

Hi @Chandrian I suggest using the SDK's feature/s3/manager#GetBucketRegion utility instead of the API call directly. The HeadBucket and GetBucketLocation operations have some unexpected behavior depending on how they are called. The SDK's GetBucketRegion utility takes care of that and should always be able to return the region a bucket was created in.

@skotambkar skotambkar merged commit 4cd4de5 into aws:main Jan 14, 2021
@Chandrian
Copy link

Hi @Chandrian I suggest using the SDK's feature/s3/manager#GetBucketRegion utility instead of the API call directly. The HeadBucket and GetBucketLocation operations have some unexpected behavior depending on how they are called. The SDK's GetBucketRegion utility takes care of that and should always be able to return the region a bucket was created in.

Thank you, GetBucketRegion is working perfectly

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.

LocationRestraint always empty on GetBucketLocation call
3 participants