无法连接到端点URL:“ https://api.pricing.us-west-2.amazonaws.com/”

时间:2019-09-20 12:20:15

标签: boto3

当我尝试从AWS boto3库中获取价格时出现此错误。 “无法连接到端点URL:“ https://api.pricing.us-west-2.amazonaws.com/

import boto3
client = boto3.client('pricing')
response = client.describe_services()

print(response)

1 个答案:

答案 0 :(得分:0)

只有两个地区可以使用该定价API。参见documentation

AWS Price List Service
Region Name             Region      Endpoint                                Protocol
US East (N. Virginia)   us-east-1   api.pricing.us-east-1.amazonaws.com     HTTPS
Asia Pacific (Mumbai)   ap-south-1  api.pricing.ap-south-1.amazonaws.com    HTTPS

您应仅使用以下区域:

client = boto3.client('pricing', region_name='us-east-1')