- Newest
- Most votes
- Most comments
Hi,
I believe that you made a request using AWS CLI with hostname. But using hostname is for REST API so if you want to use CLI, you should use ARN and if you want to use hostname, you should use REST API.
Please refer to below.
When you use the REST APIs for Amazon S3 data operations (for example, GetObject) through a Multi-Region Access Point, the hostname for the request is <MRAP_alias>.accesspoint.s3-global.amazonaws.com. For example, to make a GetObject request through the Multi-Region Access Point with alias mfzwi23gnjvgw.mrap, make a request to the hostname mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com. Note the s3-global portion of the hostname that indicates this hostname is not for a specific Region.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/MultiRegionAccessPointRequests.html
Thanks
Hi Gaurav, I have same use case where I created a MRAP and want to access it using cURL/Postman. Could you please provide steps to do it?
Relevant content
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 9 months ago
The AWS docs mention that to use the APIs the CLI or the SDKs should be used (https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html). I have tried both the methods but both give me the same issue with the mrap hostname although both work with the ARN.
I tried the following ways:
Using the aws s3api CLI command $ aws s3api list-objects-v2 --bucket <mrap_alias>.mrap.accesspoint.s3-global.amazonaws.com An error occurred (NoSuchBucket) when calling the ListObjectsV2 operation: The specified bucket does not exist
Using the AWS Python SDK for S3 $ python3 -c "import boto3; boto3.client('s3').list_objects_v2(Bucket='<mrap_alias>.mrap.accesspoint.s3-global.amazonaws.com');" botocore.errorfactory.NoSuchBucket: An error occurred (NoSuchBucket) when calling the ListObjectsV2 operation: The specified bucket does not exist
Is there anything special that needs to be configured that I am missing here while using these methods?
Finally got it working. Tried the REST API directly via Postman/cURL and it worked. Looks like the s3api CLI and Python SDK S3 client doesn't support this today.
curl --location --request GET 'https://<mrap_alias>.mrap.accesspoint.s3-global.amazonaws.com'
--header 'X-Amz-Content-Sha256: <sha256-token>'
--header 'X-Amz-Date: 20220114T181915Z'
--header 'Authorization: AWS4-HMAC-SHA256 Credential=<credentials>/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<signature>'
Thanks Eunsu_Shin!