私はのbotoで作業をいくつかRoute53オートメーションを取得しようと、この小さなboto3(バージョン1.3.1)の例があることに気づいた。boto3 Route53は、エンドポイントのURLに接続できませんでした文句:
import boto3
client = boto3.client('route53')
print client.list_hosted_zones()
がで吹きます苦情:
File "... venv/lib/python2.7/site-packages/botocore/retryhandler.py", line 356, in _check_caught_exception raise caught_exception botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://route53.us-east-1e.amazonaws.com/2013-04-01/hostedzone"
(バージョン2.38.0を使用して)、この類似しboto2コードが正常に動作するようですながら:
from boto.route53.connection import Route53Connection
r53_conn = Route53Connection()
print r53_conn.get_all_hosted_zones()
と私のホストゾーンに関する情報の辞書を表示します。私はエンドポイントsuggested by Amazonを使用してにboto3同軸しようとすると、このように、(それが見えてもboto3 ...デフォルトでこれを行う方法を知っている必要があります):
File "... venv/lib/python2.7/site-packages/botocore/client.py", line 572, in _make_api_call raise ClientError(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (SignatureDoesNotMatch) when calling the ListHostedZones operation: Credential should be scoped to a valid region, not 'us-east-1e'.:
client = boto3.client('route53', endpoint_url='https://route53.amazonaws.com')
私はこのエラーを取得します
Route53と正しく会話する方法をboto3に教えるために特に必要なことはありますか?また、boto2がこれを自動的に行う方法を知っているように見えるのはなぜですか?
私は〜/ .aws/configに 'region = us-east-1'の代わりに' region = us-east-1e'を持っていました。ありがとう! –