【问题标题】:Adding Tags in DynamoDB GlobalTable CloudFormation Template在 DynamoDB GlobalTable CloudFormation 模板中添加标签
【发布时间】:2021-11-03 12:21:39
【问题描述】:

我需要为 DynamoDB Global table CFT 添加一些标签,尝试在下面编写一个示例 cft。

在这里,我使用 KMS 密钥为 dynamoDB 全局表创建资源并在 SSESpecification 中添加标签:

AWSTemplateFormatVersion: 2010-09-09
Description: AWS CloudFormation Template to create global tables
Resources:
  globalTableExample:
    Type: 'AWS::DynamoDB::GlobalTable'
    Properties:
      TableName: sample1
      AttributeDefinitions:
        - AttributeName: PK
          AttributeType: S
      KeySchema:
        - AttributeName: PK
          KeyType: HASH
      BillingMode: PAY_PER_REQUEST
      StreamSpecification:
        StreamViewType: NEW_AND_OLD_IMAGES
      SSESpecification:
        SSEEnabled: true
        SSEType: "KMS"
      Replicas:
        - Region: us-east-1
      Tags:
      - Key: Name
        Value: mytable
      - Key: Region
        Value: east

 
         

getting error **Properties validation failed for resource globalTableExample with message: #: extraneous key [Tags] is not permitted**

有人可以建议我如何使用标签吗?

【问题讨论】:

  • 究竟是什么错误?
  • 资源 globalTableExample 的属性验证失败,消息为:#: extraneous key [Tags] is not allowed

标签: amazon-web-services amazon-dynamodb amazon-cloudformation


【解决方案1】:

如果您检查AWS::DynamoDB::GlobalTable 的定义,您会发现标签不受支持。您可以尝试使用TagResource,但这需要您在CFN 中写入custom resource

【讨论】:

    猜你喜欢
    • 2022-08-11
    • 2017-08-13
    • 2020-01-15
    • 2019-08-08
    • 2013-08-07
    • 1970-01-01
    • 2019-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多