CloudFormation模板的保留字?

时间:2018-02-20 17:31:05

标签: amazon-web-services amazon-cloudformation

CloudFormation模板是否有保留字,变量等?我已经指定了名为" Config":

的DynamoDB表
  # ...standard CF definition
  Resources:
    # ...other resources that correctly build
    Config:
      Type: AWS::DynamoDB::Table
      Properties:
        TableName: my-app-config
        AttributeDefinitions:
          - AttributeName: name
            AttributeType: S
        KeySchema:
          - AttributeName: name
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1

...并应用了模板,但未创建资源。我在CloudFormation控制台中看不到任何错误。

1 个答案:

答案 0 :(得分:1)

您的资源名称(Config)不应导致任何问题。

Config资源必须嵌套在Resources对象下,如下所示:

---
AWSTemplateFormatVersion: '2010-09-09'
Description: My Stack

Resources:
  Config:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: my-app-config
      AttributeDefinitions:
        - AttributeName: name
          AttributeType: S
      KeySchema:
        - AttributeName: name
          KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: 1
        WriteCapacityUnits: 1