amazon-dynamodb - 为什么我的 CloudFormation 模板在构建具有单个分区键的简单 DynamoDB 时总是失败?
问题描述
我正在尝试使用 CloudFormation 创建一个简单的 DynamoDB 表。
堆栈本身的创建(甚至没有达到表的创建)总是失败并显示一条Internal Failure. Rollback requested by user
消息。
事件选项卡中没有其他信息。奇怪的是,它在创建堆栈时失败,甚至没有尝试创建 DynamoDB 资源。
这适用于具有分区键且没有排序键的简单 DynamoDB 表:
Resources:
PortalRolesTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: test-env-wb-portal-roles
AttributeDefinitions:
- AttributeName: name
AttributeType: S
KeySchema:
- AttributeName: name
KeyType: HASH
这应该创建表。我有另一个更复杂的模板,它成功构建并创建了一个带有二级索引、排序键和 TTL 等的堆栈。我不知道为什么我对此没有任何运气。
解决方案
我刚刚使用了 AWS - Chrome Web Store 的精彩控制台记录器来生成模板并得到:
AWSTemplateFormatVersion: "2010-09-09"
Resources:
dynamodb1a42db5:
Type: "AWS::DynamoDB::Table"
Properties:
TableName: "test-env-wb-portal-roles"
BillingMode: "PROVISIONED"
KeySchema:
-
AttributeName: "name"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
SSESpecification:
Enabled: false
这似乎KeySchema
是一个字典列表,需要将破折号与字典值分开。
请参阅以下 YAML 代码示例:AWS::DynamoDB::Table - AWS CloudFormation
推荐阅读
- angular - Ionic keyboard.isVisible 属性不能正确控制元素的可见性
- c# - DataGridView 双缓冲在哪里调用
- reactjs - React:将每 3 个组件包装成一个 div
- makefile - 从另一个目标的结果构造一个目标
- python-3.x - pyAudio 不起作用 - OSError: [Errno -9999] 意外的主机错误
- javascript - React update a var 添加两个状态
- xamarin - Xamarin FontImageSource 字形未显示
- javascript - Service Worker 中的动态缓存名称
- c++ - OpenGL:Arcball 相机旋转问题
- django - SAML 2.0 + Keycloak + Django