From ae2413952d3fc7d8130a57d42160405998fc474d Mon Sep 17 00:00:00 2001 From: Abhishek Tiwari Date: Fri, 10 Jan 2025 19:35:44 +0000 Subject: [PATCH] feat: make nat_ip of access_config optional --- modules/instance_template/README.md | 2 +- modules/instance_template/metadata.display.yaml | 2 +- modules/instance_template/metadata.yaml | 2 +- modules/instance_template/variables.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/instance_template/README.md b/modules/instance_template/README.md index 5d3dd7a9..d502b066 100644 --- a/modules/instance_template/README.md +++ b/modules/instance_template/README.md @@ -13,7 +13,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| access\_config | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. |
list(object({
nat_ip = string
network_tier = string
}))
| `[]` | no | +| access\_config | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. |
list(object({
nat_ip = optional(string)
network_tier = string
}))
| `[]` | no | | additional\_disks | List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name |
list(object({
auto_delete = optional(bool, true)
boot = optional(bool, false)
device_name = optional(string)
disk_name = optional(string)
disk_size_gb = optional(number)
disk_type = optional(string)
disk_labels = optional(map(string), {})
interface = optional(string)
mode = optional(string)
source = optional(string)
source_image = optional(string)
source_snapshot = optional(string)
}))
| `[]` | no | | additional\_networks | Additional network interface details for GCE, if any. |
list(object({
network = string
subnetwork = string
subnetwork_project = string
network_ip = string
nic_type = string
stack_type = string
queue_count = number
access_config = list(object({
nat_ip = string
network_tier = string
}))
ipv6_access_config = list(object({
network_tier = string
}))
alias_ip_range = list(object({
ip_cidr_range = string
subnetwork_range_name = string
}))
}))
| `[]` | no | | alias\_ip\_range | An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
ip\_cidr\_range: The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. At the time of writing only a netmask (e.g. /24) may be supplied, with a CIDR format resulting in an API error.
subnetwork\_range\_name: The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used. |
object({
ip_cidr_range = string
subnetwork_range_name = string
})
| `null` | no | diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index 365723b0..9f0abce5 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/instance_template/metadata.yaml b/modules/instance_template/metadata.yaml index 3fa05336..9b4d93c5 100644 --- a/modules/instance_template/metadata.yaml +++ b/modules/instance_template/metadata.yaml @@ -327,7 +327,7 @@ spec: description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. varType: |- list(object({ - nat_ip = string + nat_ip = optional(string) network_tier = string })) defaultValue: [] diff --git a/modules/instance_template/variables.tf b/modules/instance_template/variables.tf index f15468df..1819c27b 100644 --- a/modules/instance_template/variables.tf +++ b/modules/instance_template/variables.tf @@ -375,7 +375,7 @@ variable "confidential_instance_type" { variable "access_config" { description = "Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet." type = list(object({ - nat_ip = string + nat_ip = optional(string) network_tier = string })) default = []