我们正在使用DynamoDB开发Java Spring Boot应用程序 . 我正在尝试使用.ebextensions在DynamoDB中创建几个表 . 到目前为止,我设法使用eb cli中包含的.ebextensions文件夹部署生成的jar文件 . 在其中我有一个database.config文件,其中包含以下内容:
Resources:
Book:
Type: AWS::DynamoDB::Table
Properties:
TableName: Book
KeySchema:
HashKeyElement: {AttributeName: id, AttributeType: S}
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1}
Subject:
Type: AWS::DynamoDB::Table
Properties:
TableName: Subject
KeySchema:
HashKeyElement: {AttributeName: id, AttributeType: S}
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1}
User:
Type: AWS::DynamoDB::Table
Properties:
TableName: User
KeySchema:
HashKeyElement: {AttributeName: id, AttributeType: S}
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1}
由于某种原因,只创建列表中的最后一个表(用户) . 知道为什么没有创建其他两个?如果我只在脚本中保留其中一个,则按预期创建一个 .
有没有人有更好的想法在新部署上创建和更新DynamoDB表? .ebextensions配置文件很有用,但我们必须确保它们在每次发布之前都包含正确的信息 .
谢谢,克里斯蒂安 .
1 回答
AWS技术支持的答案: