AWS S3 CLI - Could not connect to the endpoint URL

前端 未结 12 1199
情书的邮戳
情书的邮戳 2020-12-07 21:46
$ aws s3 ls

Could not connect to the endpoint URL: \"https://s3.us-east-1a.amazonaws.com/\"

What could be the problem?

相关标签:
12条回答
  • 2020-12-07 22:12

    You should specify the region in your CLI script, rather than rely on default region specified using aws configure (as the current most popular answer asserts). Another answer alluded to that, but the syntax is wrong if you're using CLI via AWS Tools for Powershell.

    This example forces region to us-west-2 (Northern California), PowerShell syntax:

    aws s3 ls --region us-west-2
    
    0 讨论(0)
  • 2020-12-07 22:15

    Probably, there is something wrong with the default region while configuring aws. In your case, the URL says "https://s3.us-east-1a.amazonaws.com/"

    In your command prompt,

    aws configure, enter your keys, Now fix your region from us-east-1a to us-east-1.

    Kindly check the syntax according to the CLI you are using. This will be helpful.

    0 讨论(0)
  • 2020-12-07 22:16

    Some AWS services are just available in specific regions that do not match your actual region. If this is the case you can override the standard setting by adding the region to your actual cli command.

    This might be a handy solution for people that do not want to change their default region in the config file. IF your general config file is not set: Please check the suggestions above.

    In this example the region is forced to eu-west-1 (e.g. Ireland):

    aws s3 ls --region=eu-west-1
    

    Tested and used with aws workmail to delete users:

    aws workmail delete-user --region=eu-west-1 --organization-id [org-id] --user-id [user-id]
    

    I derived the idea from this thread and it works perfect for me - so I wanted to share it. Hope it helps!

    0 讨论(0)
  • 2020-12-07 22:19

    The solution to my problem was to run:

        sudo aws configure
    

    Enter your credentials and then run:

        sudo aws s3 ls
    

    A different solution was to make sure that the region in the .aws/config file is the same as the endpoints

    0 讨论(0)
  • 2020-12-07 22:22

    You probably have something wrong in your default profile for the default region.

    Check your file at ~/.aws/config, you have something like

    [default]
    region=us-east-1a
    ...
    

    Fix the region to region=us-east-1 and then the command will work correctly

    0 讨论(0)
  • 2020-12-07 22:22

    Everyone has different defaults, and interestingly it will change after time. As an example, first I was on global, and then after 15 minutes it shows Ohio (which is us-east-2).

    The best approach is to check it during your work -- in console of your AWS working area, just set it on the right above side near your name on top bar check your region name and click on the down arrow to see your region.

    In AWS CLI type aws configure or aws2 configure, give your access and secret id, then during default region, write your region and press Enter.

    You will definitely get access to specific region set and it will work.

    0 讨论(0)
提交回复
热议问题