Added dynamic description of compute-vm (#328)

* Added dynamic description of compute-vm

* Re-ordered variables alphabetically
This commit is contained in:
Caio Tavares 2021-10-16 10:23:11 -04:00 committed by GitHub
parent e595f22963
commit 6cb381334e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -258,6 +258,7 @@ module "instance-group" {
| *can_ip_forward* | Enable IP forwarding. | <code title="">bool</code> | | <code title="">false</code> |
| *confidential_compute* | Enable Confidential Compute for these instances. | <code title="">bool</code> | | <code title="">false</code> |
| *create_template* | Create instance template instead of instances. | <code title="">bool</code> | | <code title="">false</code> |
| *description* | Description of a Compute Instance. | <code title="">string</code> | | <code title="">Managed by the compute-vm Terraform module.</code> |
| *enable_display* | Enable virtual display on the instances | <code title="">bool</code> | | <code title="">false</code> |
| *encryption* | Encryption options. Only one of kms_key_self_link and disk_encryption_key_raw may be set. If needed, you can specify to encrypt or not the boot disk. | <code title="object&#40;&#123;&#10;encrypt_boot &#61; bool&#10;disk_encryption_key_raw &#61; string&#10;kms_key_self_link &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="">null</code> |
| *group* | Define this variable to create an instance group for instances. Disabled for template use. | <code title="object&#40;&#123;&#10;named_ports &#61; map&#40;number&#41;&#10;&#125;&#41;">object({...})</code> | | <code title="">null</code> |

View File

@ -122,7 +122,7 @@ resource "google_compute_instance" "default" {
zone = var.zone
name = var.name
hostname = var.hostname
description = "Managed by the compute-vm Terraform module."
description = var.description
tags = var.tags
machine_type = var.instance_type
min_cpu_platform = var.min_cpu_platform
@ -253,7 +253,7 @@ resource "google_compute_instance_template" "default" {
project = var.project_id
region = local.region
name_prefix = "${var.name}-"
description = "Managed by the compute-vm Terraform module."
description = var.description
tags = var.tags
machine_type = var.instance_type
min_cpu_platform = var.min_cpu_platform
@ -354,7 +354,7 @@ resource "google_compute_instance_group" "unmanaged" {
)
zone = var.zone
name = var.name
description = "Terraform-managed."
description = var.description
instances = [google_compute_instance.default.0.self_link]
dynamic "named_port" {
for_each = var.group.named_ports != null ? var.group.named_ports : {}

View File

@ -92,7 +92,11 @@ variable "create_template" {
type = bool
default = false
}
variable "description" {
description = "Description of a Compute Instance."
type = string
default = "Managed by the compute-vm Terraform module."
}
variable "enable_display" {
description = "Enable virtual display on the instances"
type = bool
@ -243,3 +247,5 @@ variable "zone" {
description = "Compute zone."
type = string
}