2
votes

I want to get the endpoint of a given region. Here is the link of the S3 regions and thier correspondiong endpoint.

Ex.

  • for us-east-1, the endpoint is s3.amazonaws.com,
  • for us-east-2, the endpoint is s3.us-east-2.amazonaws.com,
  • for us-east-2, the endpoint is s3.us-west-1.amazonaws.com, and so on...

Is there any way to get the endpoints via AWS cli? Thanks :)

2
Add something that you tried, then only we can offer you some help. - Mathews Sunny
I tried searching any way but I haven't found any - Jane S.

2 Answers

3
votes

There isn't an API for this.

If you like consistency, and a formula that should be valid for all regions going forward, then you might like this format:

s3.dualstack.${region}.amazonaws.com

All regions support this format, including us-east-1, and this endpoint is dual-stack, so it works with IPv4 and IPv6.

You can also prepend the bucket name and a dot to the beginning and have the individual bucket endpoint.

See the official list at Regions and Endpoints.