使用 Amazon EventBridge 监控不合规标签
您可以使用 Amazon EventBridge(之前称为 Amazon CloudWatch Events)监控何时引入了不合规标签。在以下示例事件中,tag-policy-compliant
的 "false"
值表示新标签不符合有效标签策略。
{ "detail-type": "Tag Change on Resource", "region": "us-east-1", "resources": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-0000000aaaaaaaaaa" ], "detail": { "changed-tag-keys": [ "a-new-key" ], "service": "ec2", "resource-type": "instance", "version": 3, "tag-policy-compliant": "false", "tags": { "a-new-key": "tag-value-on-new-key-just-added" } } }
您可以订阅事件并指定要监控的字符串或模式。有关 EventBridge 的详细信息,请参阅《Amazon EventBridge 用户指南》。