variable "json_file_name_list" { type = "list" default= '${dirname(var.path)}'}
resource "aws_dynamodb_table_item" "init-items" { count = "${length(var.json_file_name_list)}" table_name = "${var.table_name}" hash_key = "key" item = <<EOF${file("${var.path}${element(var.json_file_name_list, count.index)}.json")}EOF}
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/9192e2ce-2f18-4d37-ae9b-c07ed2099e96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
resource "null_resource" "get_file_list" {
provisioner "local-exec" {
command = "ls ${var.data_file_path} > file_json_list"
}}
output "json_file_list" {
value =<<EOF
${file("file_json_list")}
EOF
}