diff --git a/modules/apigee/README.md b/modules/apigee/README.md index 5a8eb525..378604b4 100644 --- a/modules/apigee/README.md +++ b/modules/apigee/README.md @@ -180,13 +180,13 @@ module "apigee" { | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [project_id](variables.tf#L95) | Project ID. | string | ✓ | | +| [project_id](variables.tf#L96) | Project ID. | string | ✓ | | | [addons_config](variables.tf#L17) | Addons configuration. | object({…}) | | null | | [endpoint_attachments](variables.tf#L29) | Endpoint attachments. | map(object({…})) | | {} | | [envgroups](variables.tf#L39) | Environment groups (NAME => [HOSTNAMES]). | map(list(string)) | | {} | | [environments](variables.tf#L46) | Environments. | map(object({…})) | | {} | -| [instances](variables.tf#L65) | Instances ([REGION] => [INSTANCE]). | map(object({…})) | | {} | -| [organization](variables.tf#L80) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | +| [instances](variables.tf#L65) | Instances ([REGION] => [INSTANCE]). | map(object({…})) | | {} | +| [organization](variables.tf#L81) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | ## Outputs diff --git a/modules/apigee/main.tf b/modules/apigee/main.tf index 4a2e3d25..c5c0918a 100644 --- a/modules/apigee/main.tf +++ b/modules/apigee/main.tf @@ -86,7 +86,7 @@ resource "google_apigee_environment_iam_binding" "binding" { resource "google_apigee_instance" "instances" { for_each = var.instances - name = "instance-${each.key}" + name = coalesce(each.value.name, "instance-${each.key}") display_name = each.value.display_name description = each.value.description location = each.key diff --git a/modules/apigee/variables.tf b/modules/apigee/variables.tf index c5832e33..b7fc1495 100644 --- a/modules/apigee/variables.tf +++ b/modules/apigee/variables.tf @@ -66,6 +66,7 @@ variable "instances" { description = "Instances ([REGION] => [INSTANCE])." type = map(object({ display_name = optional(string) + name = optional(string) description = optional(string, "Terraform-managed") runtime_ip_cidr_range = string troubleshooting_ip_cidr_range = string