amazon-web-servicesamazon-s3endpoints

How to get S3 endpoint using aws region in AWS cli?


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

Ex.

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


Solution

  • 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.