如何在 terraform dynamodb 中指定复合主键(hashkey)
How in terraform dynamodb specify composite primary key (hashkey)
我的目标是使用 AWS documentation 中描述的复合主键创建 terraform resource "aws_dynamodb_table"
。
基于 Terraform documentation 它允许 hash_key
只有一个属性名称。我怎样才能拥有一个由多个属性组成的hash_key
?
使用 range_key
terraform 参数,它是 DynamoDB 上的排序键。这样您将获得 AWS 文档中所述的复合密钥。 hash_key
称为分区键。
Partition key and sort key – Referred to as a composite primary key, this type of key is composed of two attributes. The first attribute is the partition key, and the second attribute is the sort key.
如果要查询其他属性,请尝试使用 local_secondary_index
。
我的目标是使用 AWS documentation 中描述的复合主键创建 terraform resource "aws_dynamodb_table"
。
基于 Terraform documentation 它允许 hash_key
只有一个属性名称。我怎样才能拥有一个由多个属性组成的hash_key
?
使用 range_key
terraform 参数,它是 DynamoDB 上的排序键。这样您将获得 AWS 文档中所述的复合密钥。 hash_key
称为分区键。
Partition key and sort key – Referred to as a composite primary key, this type of key is composed of two attributes. The first attribute is the partition key, and the second attribute is the sort key.
如果要查询其他属性,请尝试使用 local_secondary_index
。