AWS摘要是基于AWS资源的标记自动创建的,除非资源的标记更改了。可以通过以下代码示例来解决此问题:
import boto3
# Create a boto3 resource client for the AWS service you want to use
my_service = boto3.resource('my_service')
# Get the resource you want to tag
my_resource = my_service.Resource('my_resource_name')
# Tag the resource (and change the tag value if it already exists)
my_resource.create_tags(
Tags=[
{
'Key': 'my_tag_key',
'Value': 'my_new_tag_value'
}
]
)
此示例将在资源上创建一个新标记(如果它不存在)或更新现有标记(如果它已经存在)。如果您需要使用不同的标记键和/或值,请更改相关参数。
这样,AWS会在资源上创建新的摘要,并且只有在标记更改时才会更改。