Why do I get the following error?
Using Terraform and following the official published guide here I'm trying to create a simple compartment on OCI and get the following error:
│ Error: Error in function call │ │ on .terraform/modules/iam_compartment/modules/iam-compartment/main.tf line 36, in locals: │ 36: parent_compartment_ids = concat(flatten(data.oci_identity_compartments.this.*.compartments), list(map("compartment_id", ""))) │ │ Call to function "map" failed: the "map" function was deprecated in Terraform v0.12 and is no longer available; use tomap({ ... }) syntax to write a literal map.
My terraform main.tf file:
module "iam_compartment" {
source = "oracle-terraform-modules/iam/oci//modules/iam-compartment"
version = "2.0.1"
tenancy_ocid = var.provider.tenancy_id
compartment_id = var.provider.tenancy_id
compartment_name = "tf_example_compartment"
compartment_description = "compartment created by terraform"
compartment_create = true
enable_delete = true
}
Version:
Terraform v1.1.3 on darwin_amd64
- provider registry.terraform.io/hashicorp/oci v4.59.0
- provider registry.terraform.io/hashicorp/template v2.2.0
Steps to recreate
- terraform init
- terraform plan