Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update variable descriptions and metadata #442

Merged
merged 2 commits into from
Nov 6, 2024
Merged
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
4 changes: 2 additions & 2 deletions autogen/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

variable "project_id" {
type = string
description = "The GCP project ID"
description = "The Google Cloud project ID"
default = null
}

Expand All @@ -35,7 +35,7 @@ variable "mig_name" {
}

variable "region" {
description = "The GCP region where the managed instance group resides."
description = "The Google Cloud region where the managed instance group resides."
type = string
}

Expand Down
3 changes: 2 additions & 1 deletion examples/confidential_computing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ resource "google_kms_crypto_key_iam_binding" "crypto_key" {
}

module "instance_template" {
source = "../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 12.0"

region = var.region
project_id = var.project_id
Expand Down
3 changes: 2 additions & 1 deletion examples/instance_template/confidential_computing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

module "instance_template" {
source = "../../../modules/instance_template"
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 12.0"

region = var.region
project_id = var.project_id
Expand Down
14 changes: 7 additions & 7 deletions examples/umig/named_ports/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ module "umig" {
source = "terraform-google-modules/vm/google//modules/umig"
version = "~> 12.0"

project_id = var.project_id
subnetwork = var.subnetwork
project_id = var.project_id
subnetwork = var.subnetwork
subnetwork_project = var.project_id
num_instances = var.num_instances
hostname = "umig-named-ports"
instance_template = module.instance_template.self_link
named_ports = var.named_ports
region = var.region
num_instances = var.num_instances
hostname = "umig-named-ports"
instance_template = module.instance_template.self_link
named_ports = var.named_ports
region = var.region
}
12 changes: 6 additions & 6 deletions examples/umig/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ module "umig" {
source = "terraform-google-modules/vm/google//modules/umig"
version = "~> 12.0"

project_id = var.project_id
subnetwork = var.subnetwork
project_id = var.project_id
subnetwork = var.subnetwork
subnetwork_project = var.project_id
num_instances = var.num_instances
hostname = "umig-simple"
instance_template = module.instance_template.self_link
region = var.region
num_instances = var.num_instances
hostname = "umig-simple"
instance_template = module.instance_template.self_link
region = var.region
}
14 changes: 7 additions & 7 deletions examples/umig/static_ips/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ module "umig" {
source = "terraform-google-modules/vm/google//modules/umig"
version = "~> 12.0"

project_id = var.project_id
subnetwork = var.subnetwork
project_id = var.project_id
subnetwork = var.subnetwork
subnetwork_project = var.project_id
num_instances = var.num_instances
hostname = "umig-static-ips"
instance_template = module.instance_template.self_link
static_ips = var.static_ips
region = var.region
num_instances = var.num_instances
hostname = "umig-static-ips"
instance_template = module.instance_template.self_link
static_ips = var.static_ips
region = var.region
}
41 changes: 23 additions & 18 deletions modules/compute_disk_snapshot/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ spec:
location: examples/compute_instance/tags
interfaces:
variables:
- name: disks
description: List of self_links persistent disks to attach the snapshot policy to (ie. projects/project_id/disks/diskname/zones/zone_name)
varType: list(string)
defaultValue: []
- name: module_depends_on
description: List of modules or resources this module depends on
varType: list(any)
defaultValue: []
- name: name
description: Name of the resource policy to create
varType: string
Expand All @@ -100,16 +92,6 @@ spec:
description: Region where resource policy resides
varType: string
required: true
- name: snapshot_properties
description: The properties of the schedule policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#snapshot_properties
varType: |-
object(
{
guest_flush = bool
labels = map(string)
storage_locations = list(string)
}
)
- name: snapshot_retention_policy
description: The retention policy to be applied to the schedule policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#retention_policy
varType: |-
Expand Down Expand Up @@ -150,6 +132,24 @@ spec:
}
)
required: true
- name: snapshot_properties
description: The properties of the schedule policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#snapshot_properties
varType: |-
object(
{
guest_flush = bool
labels = map(string)
storage_locations = list(string)
}
)
- name: disks
description: List of self_links persistent disks to attach the snapshot policy to (ie. projects/project_id/disks/diskname/zones/zone_name)
varType: list(string)
defaultValue: []
- name: module_depends_on
description: List of modules or resources this module depends on
varType: list(any)
defaultValue: []
outputs:
- name: attachments
description: Disk attachments to the resource policy.
Expand All @@ -170,3 +170,8 @@ spec:
- serviceusage.googleapis.com
- compute.googleapis.com
- iam.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 3.71, < 7"
- source: hashicorp/null
version: ">= 2.1"
107 changes: 55 additions & 52 deletions modules/compute_instance/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ spec:
location: examples/compute_instance/tags
interfaces:
variables:
- name: network
description: Network to deploy to. Only one of network or subnetwork should be specified.
varType: string
defaultValue: ""
- name: subnetwork
description: Subnet to deploy to. Only one of network or subnetwork should be specified.
varType: string
defaultValue: ""
- name: subnetwork_project
description: The project that subnetwork belongs to
varType: string
defaultValue: ""
- name: hostname
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)
defaultValue: []
- name: access_config
description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet.
varType: |-
Expand All @@ -88,77 +112,53 @@ spec:
network_tier = string
}))
defaultValue: []
- name: add_hostname_suffix
description: Adds a suffix to the hostname
varType: bool
defaultValue: true
- name: alias_ip_ranges
description: (Optional) An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
- name: ipv6_access_config
description: IPv6 access configurations. Currently a max of 1 IPv6 access configuration is supported. If not specified, the instance will have no external IPv6 Internet access.
varType: |-
list(object({
ip_cidr_range = string
subnetwork_range_name = string
network_tier = string
}))
defaultValue: []
- name: deletion_protection
description: "Enable deletion protection on this instance. Note: you must disable deletion protection before removing the resource, or the instance cannot be deleted and the Terraform run will not complete successfully."
varType: bool
defaultValue: false
- name: hostname
description: Hostname of instances
- name: num_instances
description: Number of instances to create. This value is ignored if static_ips is provided.
varType: number
defaultValue: "1"
- name: instance_template
description: Instance template self_link used to create compute instances
varType: string
required: true
- name: region
description: Region where the instances should be created.
varType: string
- name: zone
description: Zone where the instances should be created. If not specified, instances will be spread across available zones in the region.
varType: string
defaultValue: ""
- name: hostname_suffix_separator
description: Separator character to compose hostname when add_hostname_suffix is set to true.
varType: string
defaultValue: "-"
- name: instance_template
description: Instance template self_link used to create compute instances
varType: string
required: true
- name: ipv6_access_config
description: IPv6 access configurations. Currently a max of 1 IPv6 access configuration is supported. If not specified, the instance will have no external IPv6 Internet access.
- name: deletion_protection
description: "Enable deletion protection on this instance. Note: you must disable deletion protection before removing the resource, or the instance cannot be deleted and the Terraform run will not complete successfully."
varType: bool
defaultValue: false
- name: alias_ip_ranges
description: (Optional) An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
varType: |-
list(object({
network_tier = string
ip_cidr_range = string
subnetwork_range_name = string
}))
defaultValue: []
- name: resource_policies
description: (Optional) A list of short names or self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.
varType: list(string)
defaultValue: []
- name: labels
description: (Optional) Labels to override those from the template, provided as a map
varType: map(string)
- name: network
description: Network to deploy to. Only one of network or subnetwork should be specified.
varType: string
defaultValue: ""
- name: num_instances
description: Number of instances to create. This value is ignored if static_ips is provided.
varType: number
defaultValue: "1"
- name: region
description: Region where the instances should be created.
varType: string
- name: resource_manager_tags
description: (Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource.
varType: map(string)
- name: resource_policies
description: (Optional) A list of short names or self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.
varType: list(string)
defaultValue: []
- name: static_ips
description: List of static IPs for VM instances
varType: list(string)
defaultValue: []
- name: subnetwork
description: Subnet to deploy to. Only one of network or subnetwork should be specified.
varType: string
defaultValue: ""
- name: subnetwork_project
description: The project that subnetwork belongs to
varType: string
defaultValue: ""
- name: zone
description: Zone where the instances should be created. If not specified, instances will be spread across available zones in the region.
varType: string
outputs:
- name: available_zones
description: List of available zones in region
Expand All @@ -181,3 +181,6 @@ spec:
- serviceusage.googleapis.com
- compute.googleapis.com
- iam.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 3.88, < 7"
Loading