【发布时间】: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: "/"
但不确定如何定义所有列的其余部分。
提前致谢
【问题讨论】:
-
请先自行尝试:docs.aws.amazon.com/de_de/AWSCloudFormation/latest/UserGuide/…如果遇到任何问题可以寻求帮助。
-
@RobertKossendey - 我通过我形成的模板编辑了问题,但不确定如何定义其余属性(表模式列)。你能指导我如何定义它们吗?
标签: yaml amazon-dynamodb amazon-cloudformation