Ped*_*tes 13 amazon-web-services aws-cloudformation amazon-dynamodb
我已经看过这个关于DynamoDB On-demand的网站,我将我的表格(由CloudFormation创建)更新为按需.现在,当我尝试更新我的堆栈时,我收到此错误:
一个或多个参数值无效:当BillingMode为PAY_PER_REQUEST时,无法指定ReadCapacityUnits和WriteCapacityUnits
有没有办法在CloudFormation上将DynamoDB读/写容量模式设置为按需?
编辑:
我已在AWS Console上更新为按需.
编辑2:
我的模板:
DynamoDBUsersTable:
Type: AWS::DynamoDB::Table
Description: Users table
Properties:
TableName: !Sub ${StackName}-users-table
AttributeDefinitions:
- AttributeName: userId
AttributeType: S
KeySchema:
- AttributeName: userId
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 10
WriteCapacityUnits: 10
Run Code Online (Sandbox Code Playgroud)
谢谢.
Kon*_*bun 32
您需要添加BillingMode: PAY_PER_REQUEST属性并ProvisionedThroughput从表属性和所有GlobalSecondaryIndexes指定的属性中删除它们.所以最后你的模板看起来像:
DynamoDBUsersTable:
Type: AWS::DynamoDB::Table
Description: Users table
Properties:
TableName: !Sub ${StackName}-users-table
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: userId
AttributeType: S
KeySchema:
- AttributeName: userId
KeyType: HASH
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4266 次 |
| 最近记录: |