我需要帮助使用 CloudFormation 模板创建 DynamoDB table
I want help in creating DynamoDB table using CloudFormation template
我需要帮助使用 CloudFormation 模板创建 DynamoDB table。
Table 名称:oeautomator-team-config
Table 架构:
活动 - 布尔值
devResolverGroups - 列表
excludeAgingList - 布尔值
excludeNoncontrollableList - 布尔值
excludeReroutedList - 布尔值
fleetId - 字符串
managerLogin - 字符串
metricsDashboardLinks - 地图
组织名称 - 字符串
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: "/"
但不确定如何定义所有列的其余部分。
提前致谢
您不需要指定其余的属性。 Dynamo 根据定义 schemaless,除了哈希和范围键。
我需要帮助使用 CloudFormation 模板创建 DynamoDB table。
Table 名称:oeautomator-team-config Table 架构:
活动 - 布尔值
devResolverGroups - 列表
excludeAgingList - 布尔值
excludeNoncontrollableList - 布尔值
excludeReroutedList - 布尔值
fleetId - 字符串
managerLogin - 字符串
metricsDashboardLinks - 地图
组织名称 - 字符串
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: "/"
但不确定如何定义所有列的其余部分。
提前致谢
您不需要指定其余的属性。 Dynamo 根据定义 schemaless,除了哈希和范围键。