Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/umig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ See the [simple](https://github.com/terraform-google-modules/terraform-google-vm
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_config | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. | <pre>list(list(object({<br> nat_ip = string<br> network_tier = string<br> })))</pre> | `[]` | no |
| add\_hostname\_suffix | Adds a suffix to the hostname | `bool` | `true` | no |
| additional\_networks | Additional network interface details for GCE, if any. | <pre>list(object({<br> network = string<br> subnetwork = string<br> subnetwork_project = string<br> network_ip = string<br> access_config = list(object({<br> nat_ip = string<br> network_tier = string<br> }))<br> ipv6_access_config = list(object({<br> network_tier = string<br> }))<br> }))</pre> | `[]` | no |
| hostname | Hostname of instances | `string` | `""` | no |
| hostname\_suffix\_separator | Separator character to compose hostname when add\_hostname\_suffix is set to true. | `string` | `"-"` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/umig/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ data "google_compute_zones" "available" {
resource "google_compute_instance_from_template" "compute_instance" {
provider = google
count = local.num_instances
name = format("%s%s%s", local.hostname, var.hostname_suffix_separator, format("%03d", count.index + 1))
name = var.add_hostname_suffix ? format("%s%s%s", local.hostname, var.hostname_suffix_separator, format("%03d", count.index + 1)) : local.hostname
project = var.project_id
zone = local.zones[count.index % length(local.zones)]

Expand Down
3 changes: 3 additions & 0 deletions modules/umig/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
access_config:
name: access_config
title: Access Config
add_hostname_suffix:
name: add_hostname_suffix
title: Add Hostname Suffix
additional_networks:
name: additional_networks
title: Additional Networks
Expand Down
4 changes: 4 additions & 0 deletions modules/umig/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ spec:
description: Hostname of instances
varType: string
defaultValue: ""
- name: add_hostname_suffix
description: Adds a suffix to the hostname
varType: bool
defaultValue: true
- name: static_ips
description: List of static IPs for VM instances
varType: list(string)
Expand Down
6 changes: 6 additions & 0 deletions modules/umig/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ variable "hostname" {
default = ""
}

variable "add_hostname_suffix" {
description = "Adds a suffix to the hostname"
type = bool
default = true
}

variable "static_ips" {
type = list(string)
description = "List of static IPs for VM instances"
Expand Down