【问题标题】:I want help in creating DynamoDB table using CloudFormation template我在使用 CloudFormation 模板创建 DynamoDB 表方面需要帮助
【发布时间】:2021-10-04 22:47:21
【问题描述】:

我在使用 CloudFormation 模板创建 DynamoDB 表方面需要帮助。

表名:oeautomator-team-config 表架构:

活动 - 布尔值
devResolverGroups - 列表
excludeAgingList - 布尔值
excludeNoncontrollableList - 布尔值 excludeReroutedList - 布尔值
车队 ID - 字符串 managerLogin - 字符串 metricsDashboardLinks - 地图 orgName - 字符串
simFolderId - 字符串 supportResolverGroups - 列表 团队名称 - 字符串

主分区键 - teamName(字符串)

我制作了一个模板

AWSTemplateFormatVersion: 2010-09-09
Resources:
  oeautomatorteamconfigTable:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: oeautomator-team-config
      AttributeDefinitions:
        - AttributeName: "teamName"
          AttributeType: "S"
      KeySchema:
        - AttributeName: "teamName"
          KeyType: "HASH"
      TimeToLiveSpecification:
        AttributeName: "ExpirationTime"
        Enabled: true
      ProvisionedThroughput:
        ReadCapacityUnits: "5"
        WriteCapacityUnits: "5"
    DependsOn:
      - DynamoDBQueryPolicy
  DynamoDBQueryPolicy:
    Type: "AWS::IAM::Policy"
    Properties:
      PolicyName: DynamoDBQueryPolicy
      PolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: "Allow"
            Action: "dynamodb:Query"
            Resource: "*"
      Roles:
        - Ref: "oeautomatorteamconfigTableQueryRole"

  oeautomatorteamconfigTableQueryRole:
    Type: "AWS::IAM::Role"
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: "Allow"
            Principal:
              Service:
                - "dynamodb.amazonaws.com"
            Action:
              - "sts:AssumeRole"
      Path: "/"

但不确定如何定义所有列的其余部分。

提前致谢

【问题讨论】:

标签: yaml amazon-dynamodb amazon-cloudformation


【解决方案1】:

您不需要指定其余属性。 Dynamo 的定义是 schemaless,除了 hash 和 range 键。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-02
    • 1970-01-01
    • 2012-10-27
    • 2020-02-16
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 2018-02-07
    相关资源
    最近更新 更多