From c2ceaec7c02fa3438bab5023fa6fe15377b4e139 Mon Sep 17 00:00:00 2001 From: Abhishek Tiwari Date: Fri, 9 Aug 2024 07:14:21 +0000 Subject: [PATCH] Fix terraform fmt issues --- .../vpc-serverless-connector-beta/README.md | 2 +- modules/vpc-serverless-connector-beta/main.tf | 14 ++++++------- .../metadata.yaml | 20 +++++++++---------- .../variables.tf | 20 +++++++++---------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/vpc-serverless-connector-beta/README.md b/modules/vpc-serverless-connector-beta/README.md index 570c2768..7b42540d 100644 --- a/modules/vpc-serverless-connector-beta/README.md +++ b/modules/vpc-serverless-connector-beta/README.md @@ -34,7 +34,7 @@ module "serverless-connector" { | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | project\_id | Project in which the vpc connector will be deployed. | `string` | n/a | yes | -| vpc\_connectors | List of VPC serverless connectors. |
list(object({
name = string,
region = string,
network = optional(string, null),
subnet_name = optional(string, null),
ip_cidr_range = optional(string, null),
host_project_name = optional(string, null),
machine_type = optional(string, null),
min_instances = optional(number, null),
max_instances = optional(number, null),
max_throughput = optional(number, null)
}))
| `[]` | no | +| vpc\_connectors | List of VPC serverless connectors. |
list(object({
name = string,
region = string,
network = optional(string, null),
subnet_name = optional(string, null),
ip_cidr_range = optional(string, null),
host_project_id = optional(string, null),
machine_type = optional(string, null),
min_instances = optional(number, null),
max_instances = optional(number, null),
max_throughput = optional(number, null)
}))
| `[]` | no | ## Outputs diff --git a/modules/vpc-serverless-connector-beta/main.tf b/modules/vpc-serverless-connector-beta/main.tf index 9e6f2d47..002ef868 100644 --- a/modules/vpc-serverless-connector-beta/main.tf +++ b/modules/vpc-serverless-connector-beta/main.tf @@ -22,17 +22,17 @@ resource "google_vpc_access_connector" "connector_beta" { name = each.value.name project = var.project_id region = each.value.region - ip_cidr_range = lookup(each.value, "ip_cidr_range", null) - network = lookup(each.value, "network", null) + ip_cidr_range = each.value.ip_cidr_range + network = each.value.network dynamic "subnet" { for_each = each.value.subnet_name == null ? [] : [each.value] content { name = each.value.subnet_name - project_id = lookup(each.value, "host_project_id", null) + project_id = each.value.host_project_id } } - machine_type = lookup(each.value, "machine_type", null) - min_instances = lookup(each.value, "min_instances", null) - max_instances = lookup(each.value, "max_instances", null) - max_throughput = lookup(each.value, "max_throughput", null) + machine_type = each.value.machine_type + min_instances = each.value.min_instances + max_instances = each.value.max_instances + max_throughput = each.value.max_throughput } diff --git a/modules/vpc-serverless-connector-beta/metadata.yaml b/modules/vpc-serverless-connector-beta/metadata.yaml index cb277fca..dfc5b1c1 100644 --- a/modules/vpc-serverless-connector-beta/metadata.yaml +++ b/modules/vpc-serverless-connector-beta/metadata.yaml @@ -96,16 +96,16 @@ spec: description: List of VPC serverless connectors. varType: |- list(object({ - name = string, - region = string, - network = optional(string, null), - subnet_name = optional(string, null), - ip_cidr_range = optional(string, null), - host_project_name = optional(string, null), - machine_type = optional(string, null), - min_instances = optional(number, null), - max_instances = optional(number, null), - max_throughput = optional(number, null) + name = string, + region = string, + network = optional(string, null), + subnet_name = optional(string, null), + ip_cidr_range = optional(string, null), + host_project_id = optional(string, null), + machine_type = optional(string, null), + min_instances = optional(number, null), + max_instances = optional(number, null), + max_throughput = optional(number, null) })) defaultValue: [] outputs: diff --git a/modules/vpc-serverless-connector-beta/variables.tf b/modules/vpc-serverless-connector-beta/variables.tf index ba634db5..e36c23cf 100644 --- a/modules/vpc-serverless-connector-beta/variables.tf +++ b/modules/vpc-serverless-connector-beta/variables.tf @@ -21,16 +21,16 @@ variable "project_id" { variable "vpc_connectors" { type = list(object({ - name = string, - region = string, - network = optional(string, null), - subnet_name = optional(string, null), - ip_cidr_range = optional(string, null), - host_project_name = optional(string, null), - machine_type = optional(string, null), - min_instances = optional(number, null), - max_instances = optional(number, null), - max_throughput = optional(number, null) + name = string, + region = string, + network = optional(string, null), + subnet_name = optional(string, null), + ip_cidr_range = optional(string, null), + host_project_id = optional(string, null), + machine_type = optional(string, null), + min_instances = optional(number, null), + max_instances = optional(number, null), + max_throughput = optional(number, null) })) default = [] description = "List of VPC serverless connectors."