【发布时间】:2019-02-24 05:42:26
【问题描述】:
我尝试在我的无服务器 aws lambda 中应用 dynamodb。 我的文件是这样的:
resources:
Resources:
StoreDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: lat
AttributeType: N
- AttributeName: lng
AttributeType: N
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.environment.TableStore}
我尝试应用 lat 和 lng 作为 storeTable 的属性,只是属性不是 key Schema,但是每个 store 元素都应该有这些属性。
但是有错误:
发生错误:StoreDynamoDbTable - 属性 AttributeDefinitions 与表的KeySchema和二级不一致 索引。
如何使lat和lng只是mast属性,而不是索引的关键元素?
【问题讨论】:
标签: amazon-dynamodb serverless-framework serverless