I'm trying to use this module for Terraform: Artifact Registry module. I have a variable for Terraform of the following construct.
variable "repositories" {
description = "Repositories setup."
type = object({
owner = string
location = string
format = string
description = string
roles = map(map(string))
labels = map(string)
kms_key_name = string
})
default = {
activerepo = {
owner = "eric@xxxxxx"
location = "asia-east1"
format = "DOCKER"
description = "Docker repository"
roles = [{
members = "mark@xxxxxx"
role = "artifactregistry.admin"
},
]
labels = null
kms_key_name = null
}
}
}
When I run terraform plan I get the below output:
│ Error: Invalid default value for variable
│
│ on variables.tf line 59, in variable "repositories":
│ 59: default = {
│ 60: activeops = {
│ 61: owner = "eric@xxxxxxx"
│ 62: location = "asia-east1"
│ 63: format = "DOCKER"
│ 64: description = "Docker repository"
│ 65: roles = [{
│ 66: members = "mark@xxxxxxxx"
│ 67: role = "artifactregistry.admin"
│ 68: },
│ 69: ]
│ 70: labels = null
│ 71: kms_key_name = null
│ 72: }
│ 73: }
│
│ This default value is not compatible with the variable's type constraint: attributes
"description", "format", "kms_key_name", "labels", "location", "owner", and "roles"
are required.
What am I doing wrong here? Any help is greatly appreciated.
Thanks in advance.
Eric.