私はテラフォームテラフォームDynamoDBのインデックスループ
resource "aws_dynamodb_table" "scanner" {
name = "scanner"
read_capacity = 2
write_capacity = 1
hash_key = "public_ip"
attribute {
name = "public_ip"
type = "S"
}
attribute {
name = "region"
type = "S"
}
attribute {
name = "account_id"
type = "N"
}
global_secondary_index {
name = "cleanup-index"
hash_key = "account_id"
range_key = "region"
read_capacity = 1
write_capacity = 1
projection_type = "INCLUDE"
non_key_attributes = ["vpc_id", "instance_id", "integration_id", "private_ip"]
}
}
で、次の設定は、これは完璧に働いています。それ以来、テラフォームを再作成したインデックスにするたびにしようとします:
~ aws_dynamodb_table.scanner
global_secondary_index.3508752412.hash_key: "" => "account_id"
global_secondary_index.3508752412.name: "" => "cleanup-index"
global_secondary_index.3508752412.non_key_attributes.#: "0" => "4"
global_secondary_index.3508752412.non_key_attributes.0: "" => "vpc_id"
global_secondary_index.3508752412.non_key_attributes.1: "" => "instance_id"
global_secondary_index.3508752412.non_key_attributes.2: "" => "integration_id"
global_secondary_index.3508752412.non_key_attributes.3: "" => "private_ip"
global_secondary_index.3508752412.projection_type: "" => "INCLUDE"
global_secondary_index.3508752412.range_key: "" => "region"
global_secondary_index.3508752412.read_capacity: "" => "1"
global_secondary_index.3508752412.write_capacity: "" => "1"
global_secondary_index.3860163270.hash_key: "account_id" => ""
global_secondary_index.3860163270.name: "cleanup-index" => ""
global_secondary_index.3860163270.non_key_attributes.#: "4" => "0"
global_secondary_index.3860163270.non_key_attributes.0: "vpc_id" => ""
global_secondary_index.3860163270.non_key_attributes.1: "instance_id" => ""
global_secondary_index.3860163270.non_key_attributes.2: "private_ip" => ""
global_secondary_index.3860163270.non_key_attributes.3: "integration_id" => ""
global_secondary_index.3860163270.projection_type: "INCLUDE" => ""
global_secondary_index.3860163270.range_key: "region" => ""
global_secondary_index.3860163270.read_capacity: "1" => "0"
global_secondary_index.3860163270.write_capacity: "1" => "0"
テラフォームは、そのドキュメントに言う:DynamoDBのAPIは、属性構造(名前とタイプ)はGSI/LSIの作成または更新時に渡されることを想定しますまたは初期テーブルを作成します。このような場合、ハッシュ/範囲キーが提供されることを期待しています。これらは複数の場所で再利用されるため(つまり、テーブルの範囲キーは1つ以上のGSIの一部になる可能性があります)、重複を防ぎ一貫性を高めるためにテーブルオブジェクトに格納されます。これらのシナリオで使用されていない属性をここに追加すると、プランニングに無限ループが発生する可能性があります。しかし私は私の設定がそれに関連しているとは思わない。同様の経験ですか?私はthisとの関係を疑う。ありがとう!