gpt4 book ai didi

amazon-web-services - 我们可以使用 AWS CloudFormation Template 一次创建多个 Amazon DynamoDB 表吗?

转载 作者:行者123 更新时间:2023-12-03 07:48:22 27 4
gpt4 key购买 nike

我正在尝试使用 Cloud Formation Template 创建 Amazon DynamoDB 表。所以我的问题是我可以一次性创建多个表吗?

如果是,那么方法是什么,拥有多个“属性”或拥有多个“资源”?

您能澄清一下吗?

最佳答案

每个 DynamoDB 表都是 AWS::DynamoDB::Table 类型的资源。

添加多个资源,每个资源具有不同的表名称。例如:

Resources:
Users:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: UserID
AttributeType: S
KeySchema:
- AttributeName: UserID
KeyType: HASH
Jobs:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: UserID
AttributeType: S
- AttributeName: JobID
AttributeType: S
KeySchema:
- AttributeName: UserID
KeyType: HASH
- AttributeName: JobID
KeyType: RANGE

关于amazon-web-services - 我们可以使用 AWS CloudFormation Template 一次创建多个 Amazon DynamoDB 表吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68984931/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com