如果我们已经在使用区域端点,为什么还需要提供region_name?
而且,如果我没有为 sqs指定region_name(NoRegionError : You must specify a region)
,那么它会给出一个 Error 。在为 s3 创建客户端时,不需要region_name 。
client = boto3.client(
"sqs",
aws_access_key_id=key_id,
aws_secret_access_key=secret_key,
aws_session_token=token,
endpoint_url="https://sqs.us-east-1.amazonaws.com",
region_name="us-east-1", # For some reason region name is required here
)
client = boto3.client(
"s3",
aws_access_key_id=key_id,
aws_secret_access_key=secret_key,
aws_session_token=token,
endpoint_url="https://s3.ap-south-1.amazonaws.com", # While this works perfect
)