Reputation: 2855
Trying to create a dynamodb table item resource which contains a DynamoDB List AttributeValue:
resource "aws_dynamodb_table_item" "job" {
table_name = var.some_table.id
hash_key = var.some_table.hash_key
item = <<ITEM
{
"partitionKey": {"S": "JOBID#1"},
"workloads": [{ "S" : "w1" }, { "S" : "w2" }]
}
ITEM
}
but fails with:
Error: Invalid format of "item": Decoding failed: json: cannot unmarshal array into Go value of type dynamodb.AttributeValue
Works ok if workloads is a string type e.g. {"S": "w1"}
but not when a list. What am I doing wrong? Is this resource able to create List AttributeValues?
I'm using Terraform v1.0.0
Upvotes: 2
Views: 2223