我想帮助使用CloudFormation模板创建DynamoDB表



我需要一个使用CloudFormation模板创建DynamoDB表的帮助。

表名:oeautomator-team-config表模式:

active - Boolean
devResolverGroups - List
excludeAgingList - Boolean
excludeNoncontrollableList - BooleanexcludeReroutedList - Boolean
fleetId - StringmanagerLogin -字符串metricsDashboardLinks -映射orgName - String
simFolderId - StringsupportResolverGroups -列表teamName - String

主分区键- teamName (String)

我形成了一个模板

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: "/"

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

Thanks in advance

您不需要指定其他属性。Dynamo根据定义是无模式的,除了哈希和范围键。

最新更新