为 CloudFormation 模板中的特定资源分配标签

Assign tags to the particular resource within CloudFormation template

我想为我的 CloudFormation 模板中的特定资源分配一些标签。比方说,我想为 VPNGateway 这样做。我在模板设计器中没有看到任何特定的形式,所以,我想,我应该在 JSON 模板描述中手动添加适当的键值。

假设此 VPNGateway 的模板块如下所示:

   "XXXXXX": {
            "Type": "AWS::EC2::VPNGateway",
            "Properties": {},
            "Metadata": {
                "AWS::CloudFormation::Designer": {
                    "id": "xxxxx-yyyy-zzzzz"
                }
            }
        }

我应该在哪里放置标签信息?例如,我想添加带有键“test:key”和值“test:value”的标签。

应该在Properties块中完成:

        "Properties": {
            "Tags": [
                {
                    "Key": "test:key",
                    "Value": "test:value"
                }
            ]
        },