One - One Code All

Blog Content

boto3客户端NoRegionError:仅在某些情况下必须指定区域错误(boto3 client NoRegionError: You must specify a region error only sometimes)

Python   2019-07-28 10:20:51

boto3客户端NoRegionError:仅在某些情况下必须指定区域错误(boto3 client NoRegionError: You must specify a region error only sometimes)


One way or another you must tell boto3 in which region you wish the kms client to be created. This could be done explicitly using the region_name parameter as in:

kms = boto3.client('kms', region_name='us-west-2')


or you can have a default region associated with your profile in your ~/.aws/config file as in:

[default]
region=us-west-2
or you can use an environment variable as in:
export AWS_DEFAULT_REGION=us-west-2


but you do need to tell boto3 which region to use.


https://stackoverflow.com/questions/31948742/localhost-endpoint-to-dynamodb-local-with-boto3



上一篇:flask的SQLAlchemy基础autoflush 和 autocommit
下一篇:Python 操作Excel ,openpyxl

The minute you think of giving up, think of the reason why you held on so long.