AWS Python BOTO3资源组标记api

2024-10-02 22:30:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用这种代码的和平来获取我所有AWS标记资源的列表:

import boto3
import jsbeautifier

session = boto3.Session()
client = boto3.client('resourcegroupstaggingapi')
res=client.get_resources(
   ResourceTypeFilters=[
       #first try: 'ec2:instance'
       #second try: elasticloadbalancing:loadbalancer
       #third try: 's3:bucket' 
]
)

虽然第一个和第二个尝试很好,但第三个不起作用。错误代码为:

An error occurred (InvalidParameterException) when calling the GetResources operation: productName=s3 has no resourceType

是否有人知道“ResourceTypeFilters”支持的aws服务列表或有链接? 很多网站都介绍了如何使用ResourceGroupStagingAPI,但我找不到可用服务的列表


Tags: 代码标记importclientaws列表s3session