Boto3列出区域中的可用服务

时间:2019-06-19 13:46:16

标签: python amazon-web-services boto3

在AWS cli中,我可以在运行时获取可用服务的列表

aws help

boto3中是否有一条命令可以让我以编程方式列出在初始化boto3客户端时可以使用的可用服务?

client = boto3.client('<some service>')

我可以在documentation中看到,但我希望能够列出python服务。

2 个答案:

答案 0 :(得分:2)

您可以根据this documentation使用session.get_available_services()

session = boto3.Session(
    aws_access_key_id=MY_AWS_ACCESS_KEY_ID,
    aws_secret_access_key=MY_AWS_SECRET_ACCESS_KEY
)

services = session.get_available_services()

答案 1 :(得分:0)

虽然与boto3没有特别关系,但是请注意,您现在可以查询参数存储以获取有用的信息,例如:

  • 哪些地区活跃?
  • 在给定地区可以使用哪些服务?
  • 在哪些地区提供特定服务?

阅读Query for AWS Regions, Endpoints, and More Using AWS Systems Manager Parameter Store