title: How to import my AWS credentials for below mentioned python script to work?
body: <pre><code>import boto3
  s3 = boto3.resource('s3')
  for bucket in s3.buckets.all():
      print(bucket.name)
  </code></pre>
  
  <p>but this code does not work, how to import my AWS credentials so that this will return correct output?</p>
  
  <blockquote>
    <p><strong>error :</strong> botocore.exceptions.EndpointConnectionError: Could not connect
    to the endpoint URL: "<a href="https://s3.aws-east-2.amazonaws.com/" rel="nofollow noreferrer">https://s3.aws-east-2.amazonaws.com/</a>"</p>
  </blockquote>
  
  <p><strong><em>expected output :</em></strong>
  list of buckets in my aws account.</p>