I have the following JSON file and using it while creating users in terraform
{
"[email protected]" : [
{
"name" : "abc",
"description" : 100,
},
{
"name" : "efg",
"description" : 100
},
{
"name" : "wer",
"description" : 100
}
],
"[email protected]" : [
{
"name" : "xyz",
"description" : 100
},
{
"name" : "qwe",
"description" : 100
}
]
}
I tried with a few things but it errors out ... while usin in the resource creation. I'm unable to figure out on how to grab the keys, values
resource "oci_identity_user" "users" {
count = keys(local.users)[*]
compartment_id = var.tenancy_ocid
description = count.index[description]
name = count.index[name]
email = count.index[email]
}
Error: Invalid index
│
│ on local.tf line 14, in locals:
│ 14: services = keys(local.users[1])
│ ├────────────────
│ │ local.odsc_serivices is object with 2 attributes
│