From 0a0f02979bdc35354ff76e1da0172e10ecf64a75 Mon Sep 17 00:00:00 2001 From: Awais Malik Date: Thu, 7 Sep 2023 15:31:06 -0700 Subject: [PATCH 1/2] fix: enables metadata autogen --- Makefile | 4 + metadata.yaml | 151 ++--- modules/compute_disk_snapshot/metadata.yaml | 293 ++++----- modules/compute_instance/metadata.yaml | 316 +++++----- modules/instance_template/metadata.yaml | 593 +++++++++--------- modules/mig/metadata.yaml | 557 ++++++++-------- modules/mig_with_percent/metadata.yaml | 575 ++++++++--------- .../metadata.yaml | 380 ++++++----- modules/umig/metadata.yaml | 323 +++++----- 9 files changed, 1603 insertions(+), 1589 deletions(-) diff --git a/Makefile b/Makefile index 1ee0c3e9..6d7c137c 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ SHELL := /usr/bin/env bash DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.15 DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools REGISTRY_URL := gcr.io/cloud-foundation-cicd +ENABLE_BPMETADATA := 1 +export ENABLE_BPMETADATA # Enter docker container for local development .PHONY: docker_run @@ -68,6 +70,7 @@ docker_test_integration: .PHONY: docker_test_lint docker_test_lint: docker run --rm -it \ + -e ENABLE_BPMETADATA \ -v "$(CURDIR)":/workspace \ $(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \ /usr/local/bin/test_lint.sh @@ -76,6 +79,7 @@ docker_test_lint: .PHONY: docker_generate_docs docker_generate_docs: docker run --rm -it \ + -e ENABLE_BPMETADATA \ -v "$(CURDIR)":/workspace \ $(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \ /bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs' diff --git a/metadata.yaml b/metadata.yaml index c2c3653b..fee8281c 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,75 +19,82 @@ metadata: annotations: config.kubernetes.io/local-config: "true" spec: - title: terraform-google-vm - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - subBlueprints: - - name: compute_disk_snapshot - location: modules/compute_disk_snapshot - - name: compute_instance - location: modules/compute_instance - - name: instance_template - location: modules/instance_template - - name: mig - location: modules/mig - - name: mig_with_percent - location: modules/mig_with_percent - - name: preemptible_and_regular_instance_templates - location: modules/preemptible_and_regular_instance_templates - - name: umig - location: modules/umig - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - roles: - - level: Project + info: + title: terraform-google-vm + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + description: {} + content: + subBlueprints: + - name: compute_disk_snapshot + location: modules/compute_disk_snapshot + - name: compute_instance + location: modules/compute_instance + - name: instance_template + location: modules/instance_template + - name: mig + location: modules/mig + - name: mig_with_percent + location: modules/mig_with_percent + - name: preemptible_and_regular_instance_templates + location: modules/preemptible_and_regular_instance_templates + - name: umig + location: modules/umig + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags + interfaces: {} + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/compute_disk_snapshot/metadata.yaml b/modules/compute_disk_snapshot/metadata.yaml index 01ec0141..d3b32b0b 100644 --- a/modules/compute_disk_snapshot/metadata.yaml +++ b/modules/compute_disk_snapshot/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,147 +15,158 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintMetadata metadata: - name: terraform-google-vm + name: terraform-google-vm-compute-disk-snapshot annotations: config.kubernetes.io/local-config: "true" spec: - title: Compute Disk Snapshot - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - version: 7.9.0 - actuationTool: - type: Terraform - version: '>=0.13.0' - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - 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) - type: list(string) - default: [] - required: false - - name: module_depends_on - description: List of modules or resources this module depends on - type: list(any) - default: [] - required: false - - name: name - description: Name of the resource policy to create - type: string - required: true - - name: project - description: The project ID where the resources will be created - type: string - required: true - - name: region - description: Region where resource policy resides - type: 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 - type: |- - object( - { - guest_flush = bool - labels = map(string) - storage_locations = list(string) - } - ) - required: false - - 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 - type: |- - object( - { - max_retention_days = number - on_source_disk_delete = string - } - ) - required: true - - name: snapshot_schedule - description: The scheduled to be used by the snapshot policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#schedule - type: |- - object( - { - daily_schedule = object( - { - days_in_cycle = number - start_time = string - } - ) - hourly_schedule = object( - { - hours_in_cycle = number - start_time = string - } - ) - weekly_schedule = object( - { - day_of_weeks = set(object( - { - day = string - start_time = string - } - )) - } - ) - } - ) - required: true - outputs: - - name: attachments - description: Disk attachments to the resource policy - - name: policy - description: Resource snapshot policy details - roles: - - level: Project + info: + title: Compute Disk Snapshot + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + dir: /modules/compute_disk_snapshot + version: 9.0.0 + actuationTool: + flavor: Terraform + version: ">=0.13.0" + description: {} + content: + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + 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 + defaultValue: null + required: true + - name: project + description: The project ID where the resources will be created + varType: string + defaultValue: null + required: true + - name: region + description: Region where resource policy resides + varType: string + defaultValue: null + 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) + } + ) + defaultValue: null + - 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: |- + object( + { + max_retention_days = number + on_source_disk_delete = string + } + ) + defaultValue: null + required: true + - name: snapshot_schedule + description: "The scheduled to be used by the snapshot policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#schedule" + varType: |- + object( + { + daily_schedule = object( + { + days_in_cycle = number + start_time = string + } + ) + hourly_schedule = object( + { + hours_in_cycle = number + start_time = string + } + ) + weekly_schedule = object( + { + day_of_weeks = set(object( + { + day = string + start_time = string + } + )) + } + ) + } + ) + defaultValue: null + required: true + outputs: + - name: attachments + description: Disk attachments to the resource policy + - name: policy + description: Resource snapshot policy details + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/compute_instance/metadata.yaml b/modules/compute_instance/metadata.yaml index 3e124877..26cbd9de 100644 --- a/modules/compute_instance/metadata.yaml +++ b/modules/compute_instance/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,164 +15,164 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintMetadata metadata: - name: terraform-google-vm + name: terraform-google-vm-compute-instance annotations: config.kubernetes.io/local-config: "true" spec: - title: Compute Instance - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - version: 7.9.0 - actuationTool: - type: Terraform - version: '>=0.13.0' - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - variables: - - name: 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 - network_tier = string - })) - default: [] - required: false - - name: add_hostname_suffix - description: Adds a suffix to the hostname - type: bool - default: true - required: 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. - type: |- - list(object({ - ip_cidr_range = string - subnetwork_range_name = string - })) - default: [] - required: false - - 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.' - type: bool - default: false - required: false - - name: hostname - description: Hostname of instances - type: string - default: "" - required: false - - name: hostname_suffix_separator - description: Separator character to compose hostname when add_hostname_suffix is set to true. - type: string - default: '-' - required: false - - name: instance_template - description: Instance template self_link used to create compute instances - type: 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. - type: |- - list(object({ - network_tier = string - })) - default: [] - required: false - - name: network - description: Network to deploy to. Only one of network or subnetwork should be specified. - type: string - default: "" - required: false - - name: num_instances - description: Number of instances to create. This value is ignored if static_ips is provided. - type: number - default: "1" - required: false - - name: region - description: Region where the instances should be created. - type: string - required: false - - 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. - type: list(string) - default: [] - required: false - - name: static_ips - description: List of static IPs for VM instances - type: list(string) - default: [] - required: false - - name: subnetwork - description: Subnet to deploy to. Only one of network or subnetwork should be specified. - type: string - default: "" - required: false - - name: subnetwork_project - description: The project that subnetwork belongs to - type: string - default: "" - required: false - - name: zone - description: Zone where the instances should be created. If not specified, instances will be spread across available zones in the region. - type: string - required: false - outputs: - - name: available_zones - description: List of available zones in region - - name: instances_details - description: List of all details for compute instances - - name: instances_self_links - description: List of self-links for compute instances - roles: - - level: Project + info: + title: Compute Instance + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + dir: /modules/compute_instance + version: 9.0.0 + actuationTool: + flavor: Terraform + version: ">=0.13.0" + description: {} + content: + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags + interfaces: + variables: + - name: access_config + description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. + varType: |- + list(object({ + nat_ip = string + 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. + varType: |- + list(object({ + ip_cidr_range = string + subnetwork_range_name = 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 + 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 + defaultValue: null + 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. + varType: |- + list(object({ + network_tier = string + })) + defaultValue: [] + - name: labels + description: (Optional) Labels to override those from the template, provided as a map + varType: map(string) + defaultValue: null + - 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 + defaultValue: null + - 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 + defaultValue: null + outputs: + - name: available_zones + description: List of available zones in region + - name: instances_details + description: List of all details for compute instances + - name: instances_self_links + description: List of self-links for compute instances + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/instance_template/metadata.yaml b/modules/instance_template/metadata.yaml index 5f725051..c4c71d33 100644 --- a/modules/instance_template/metadata.yaml +++ b/modules/instance_template/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,310 +15,305 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintMetadata metadata: - name: terraform-google-vm + name: terraform-google-vm-instance-template annotations: config.kubernetes.io/local-config: "true" spec: - title: instance_template - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - version: 7.9.0 - actuationTool: - type: Terraform - version: '>=0.13.0' - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - variables: - - name: 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 - network_tier = string - })) - default: [] - required: false - - name: additional_disks - description: List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name - type: |- - list(object({ - disk_name = string - device_name = string - auto_delete = bool - boot = bool - disk_size_gb = number - disk_type = string - disk_labels = map(string) - })) - default: [] - required: false - - name: additional_networks - description: Additional network interface details for GCE, if any. - type: |- - list(object({ - network = string - subnetwork = string - subnetwork_project = string - network_ip = string - access_config = list(object({ + info: + title: instance_template + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + dir: /modules/instance_template + version: 9.0.0 + actuationTool: + flavor: Terraform + version: ">=0.13.0" + description: {} + content: + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags + interfaces: + variables: + - name: access_config + description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. + varType: |- + list(object({ nat_ip = string network_tier = string })) - ipv6_access_config = list(object({ + defaultValue: [] + - name: additional_disks + description: "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name" + varType: |- + list(object({ + disk_name = string + device_name = string + auto_delete = bool + boot = bool + disk_size_gb = number + disk_type = string + disk_labels = map(string) + })) + defaultValue: [] + - name: additional_networks + description: Additional network interface details for GCE, if any. + varType: |- + 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 + })) + })) + defaultValue: [] + - name: alias_ip_range + description: "An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.\nip_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.\nsubnetwork_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.\n" + varType: |- + object({ + ip_cidr_range = string + subnetwork_range_name = string + }) + defaultValue: null + - name: auto_delete + description: Whether or not the boot disk should be auto-deleted + varType: string + defaultValue: "true" + - name: automatic_restart + description: (Optional) Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). + varType: bool + defaultValue: true + - name: can_ip_forward + description: Enable IP forwarding, for NAT instances for example + varType: string + defaultValue: "false" + - name: disk_encryption_key + description: The id of the encryption key that is stored in Google Cloud KMS to use to encrypt all the disks on this instance + varType: string + defaultValue: null + - name: disk_labels + description: Labels to be assigned to boot disk, provided as a map + varType: map(string) + defaultValue: {} + - name: disk_size_gb + description: Boot disk size in GB + varType: string + defaultValue: "100" + - name: disk_type + description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard + varType: string + defaultValue: pd-standard + - name: enable_confidential_vm + description: Whether to enable the Confidential VM configuration on the instance. Note that the instance image must support Confidential VMs. See https://cloud.google.com/compute/docs/images + varType: bool + defaultValue: false + - name: enable_nested_virtualization + description: Defines whether the instance should have nested virtualization enabled. + varType: bool + defaultValue: false + - name: enable_shielded_vm + description: Whether to enable the Shielded VM configuration on the instance. Note that the instance image must support Shielded VMs. See https://cloud.google.com/compute/docs/images + varType: bool + defaultValue: false + - name: gpu + description: GPU information. Type and count of GPU to attach to the instance template. See https://cloud.google.com/compute/docs/gpus more details + varType: |- + object({ + type = string + count = number + }) + defaultValue: null + - 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({ network_tier = string })) - })) - default: [] - required: false - - name: alias_ip_range - description: | - 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. - type: |- - object({ - ip_cidr_range = string - subnetwork_range_name = string - }) - required: false - - name: auto_delete - description: Whether or not the boot disk should be auto-deleted - type: string - default: "true" - required: false - - name: automatic_restart - description: (Optional) Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). - type: bool - default: true - required: false - - name: can_ip_forward - description: Enable IP forwarding, for NAT instances for example - type: string - default: "false" - required: false - - name: disk_encryption_key - description: The id of the encryption key that is stored in Google Cloud KMS to use to encrypt all the disks on this instance - type: string - required: false - - name: disk_labels - description: Labels to be assigned to boot disk, provided as a map - type: map(string) - default: {} - required: false - - name: disk_size_gb - description: Boot disk size in GB - type: string - default: "100" - required: false - - name: disk_type - description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard - type: string - default: pd-standard - required: false - - name: enable_confidential_vm - description: Whether to enable the Confidential VM configuration on the instance. Note that the instance image must support Confidential VMs. See https://cloud.google.com/compute/docs/images - type: bool - default: false - required: false - - name: enable_nested_virtualization - description: Defines whether the instance should have nested virtualization enabled. - type: bool - default: false - required: false - - name: enable_shielded_vm - description: Whether to enable the Shielded VM configuration on the instance. Note that the instance image must support Shielded VMs. See https://cloud.google.com/compute/docs/images - type: bool - default: false - required: false - - name: gpu - description: GPU information. Type and count of GPU to attach to the instance template. See https://cloud.google.com/compute/docs/gpus more details - type: |- - object({ - type = string - count = number - }) - required: false - - 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. - type: |- - list(object({ - network_tier = string - })) - default: [] - required: false - - name: labels - description: Labels, provided as a map - type: map(string) - default: {} - required: false - - name: machine_type - description: Machine type to create, e.g. n1-standard-1 - type: string - default: n1-standard-1 - required: false - - name: metadata - description: Metadata, provided as a map - type: map(string) - default: {} - required: false - - name: min_cpu_platform - description: 'Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform' - type: string - required: false - - name: name_prefix - description: Name prefix for the instance template - type: string - default: default-instance-template - required: false - - name: network - description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. - type: string - default: "" - required: false - - name: network_ip - description: Private IP address to assign to the instance if desired. - type: string - default: "" - required: false - - name: on_host_maintenance - description: Instance availability Policy - type: string - default: MIGRATE - required: false - - name: preemptible - description: Allow the instance to be preempted - type: bool - default: false - required: false - - name: project_id - description: The GCP project ID - type: string - required: false - - name: region - description: Region where the instance template should be created. - type: string - required: false - - name: service_account - description: Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account. - type: |- - object({ - email = string - scopes = set(string) - }) - required: true - - name: shielded_instance_config - description: Not used unless enable_shielded_vm is true. Shielded VM configuration for the instance. - type: |- - object({ - enable_secure_boot = bool - enable_vtpm = bool - enable_integrity_monitoring = bool - }) - default: - enable_integrity_monitoring: true - enable_secure_boot: true - enable_vtpm: true - required: false - - name: source_image - description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - type: string - default: "" - required: false - - name: source_image_family - description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - type: string - default: centos-7 - required: false - - name: source_image_project - description: Project where the source image comes from. The default project contains CentOS images. - type: string - default: centos-cloud - required: false - - name: stack_type - description: The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6 or IPV4_ONLY. If not specified, IPV4_ONLY will be used. - type: string - default: IPV4_ONLY - required: false - - name: startup_script - description: User startup script to run when instances spin up - type: string - default: "" - required: false - - name: subnetwork - description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. - type: string - default: "" - required: false - - name: subnetwork_project - description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. - type: string - default: "" - required: false - - name: tags - description: Network tags, provided as a list - type: list(string) - default: [] - required: false - - name: threads_per_core - description: The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. - type: number - required: false - outputs: - - name: name - description: Name of instance template - - name: self_link - description: Self-link of instance template - - name: tags - description: Tags that will be associated with instance(s) - roles: - - level: Project + defaultValue: [] + - name: labels + description: Labels, provided as a map + varType: map(string) + defaultValue: {} + - name: machine_type + description: Machine type to create, e.g. n1-standard-1 + varType: string + defaultValue: n1-standard-1 + - name: metadata + description: Metadata, provided as a map + varType: map(string) + defaultValue: {} + - name: min_cpu_platform + description: "Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform" + varType: string + defaultValue: null + - name: name_prefix + description: Name prefix for the instance template + varType: string + defaultValue: default-instance-template + - name: network + description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. + varType: string + defaultValue: "" + - name: network_ip + description: Private IP address to assign to the instance if desired. + varType: string + defaultValue: "" + - name: nic_type + description: Valid values are "VIRTIO_NET", "GVNIC" or set to null to accept API default behavior. + varType: string + defaultValue: null + - name: on_host_maintenance + description: Instance availability Policy + varType: string + defaultValue: MIGRATE + - name: preemptible + description: Allow the instance to be preempted + varType: bool + defaultValue: false + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: Region where the instance template should be created. + varType: string + defaultValue: null + - name: service_account + description: "Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account." + varType: |- + object({ + email = string + scopes = set(string) + }) + defaultValue: null + required: true + - name: shielded_instance_config + description: Not used unless enable_shielded_vm is true. Shielded VM configuration for the instance. + varType: |- + object({ + enable_secure_boot = bool + enable_vtpm = bool + enable_integrity_monitoring = bool + }) + defaultValue: + enable_integrity_monitoring: true + enable_secure_boot: true + enable_vtpm: true + - name: source_image + description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: "" + - name: source_image_family + description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: centos-7 + - name: source_image_project + description: Project where the source image comes from. The default project contains CentOS images. + varType: string + defaultValue: centos-cloud + - name: spot + description: Provision a SPOT instance + varType: bool + defaultValue: false + - name: stack_type + description: The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are `IPV4_IPV6` or `IPV4_ONLY`. Default behavior is equivalent to IPV4_ONLY. + varType: string + defaultValue: null + - name: startup_script + description: User startup script to run when instances spin up + varType: string + defaultValue: "" + - name: subnetwork + description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. + varType: string + defaultValue: "" + - name: subnetwork_project + description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. + varType: string + defaultValue: "" + - name: tags + description: Network tags, provided as a list + varType: list(string) + defaultValue: [] + - name: threads_per_core + description: The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + varType: number + defaultValue: null + - name: total_egress_bandwidth_tier + description: Egress bandwidth tier setting for supported VM families + varType: string + defaultValue: DEFAULT + outputs: + - name: name + description: Name of instance template + - name: self_link + description: Self-link of instance template + - name: tags + description: Tags that will be associated with instance(s) + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/mig/metadata.yaml b/modules/mig/metadata.yaml index e6b83c63..1e92821f 100644 --- a/modules/mig/metadata.yaml +++ b/modules/mig/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,284 +15,285 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintMetadata metadata: - name: terraform-google-vm + name: terraform-google-vm-mig annotations: config.kubernetes.io/local-config: "true" spec: - title: Managed Instance Group (MIG) - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - version: 7.9.0 - actuationTool: - type: Terraform - version: '>=0.13.0' - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - variables: - - name: autoscaler_name - description: Autoscaler name. When variable is empty, name will be derived from var.hostname. - type: string - default: "" - required: false - - name: autoscaling_cpu - description: Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization - type: |- - list(object({ - target = number - predictive_method = string - })) - default: [] - required: false - - name: autoscaling_enabled - description: Creates an autoscaler for the managed instance group - type: string - default: "false" - required: false - - name: autoscaling_lb - description: Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization - type: list(map(number)) - default: [] - required: false - - name: autoscaling_metric - description: Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric - type: |- - list(object({ - name = string - target = number - type = string - })) - default: [] - required: false - - name: autoscaling_mode - description: Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode - type: string - required: false - - name: autoscaling_scale_in_control - description: Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control - type: |- - object({ - fixed_replicas = number - percent_replicas = number - time_window_sec = number - }) - default: - fixed_replicas: null - percent_replicas: null - time_window_sec: null - required: false - - name: cooldown_period - description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. - type: number - default: 60 - required: false - - name: distribution_policy_zones - description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. - type: list(string) - default: [] - required: false - - name: health_check - description: Health check to determine whether instances are responsive and able to do work - type: |- - object({ - type = string - initial_delay_sec = number - check_interval_sec = number - healthy_threshold = number - timeout_sec = number - unhealthy_threshold = number - response = string - proxy_header = string - port = number - request = string - request_path = string - host = string - enable_logging = bool - }) - default: - check_interval_sec: 30 - enable_logging: false - healthy_threshold: 1 - host: "" - initial_delay_sec: 30 - port: 80 - proxy_header: NONE - request: "" - request_path: / - response: "" - timeout_sec: 10 - type: "" - unhealthy_threshold: 5 - required: false - - name: health_check_name - description: Health check name. When variable is empty, name will be derived from var.hostname. - type: string - default: "" - required: false - - name: hostname - description: Hostname prefix for instances - type: string - default: default - required: false - - name: instance_template - description: Instance template self_link used to create compute instances - type: string - required: true - - name: max_replicas - description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. - type: number - default: 10 - required: false - - name: mig_name - description: Managed instance group name. When variable is empty, name will be derived from var.hostname. - type: string - default: "" - required: false - - name: mig_timeouts - description: 'Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. ' - type: |- - object({ - create = string - update = string - delete = string - }) - default: - create: 5m - delete: 15m - update: 5m - required: false - - name: min_replicas - description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. - type: number - default: 2 - required: false - - name: named_ports - description: Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports - type: |- - list(object({ - name = string - port = number - })) - default: [] - required: false - - name: project_id - description: The GCP project ID - type: string - required: false - - name: region - description: The GCP region where the managed instance group resides. - type: string - required: true - - name: scaling_schedules - description: Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules - type: |- - list(object({ - disabled = bool - duration_sec = number - min_required_replicas = number - name = string - schedule = string - time_zone = string - })) - default: [] - required: false - - name: stateful_disks - description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs - type: |- - list(object({ - device_name = string - delete_rule = string - })) - default: [] - required: false - - name: target_pools - description: The target load balancing pools to assign this group to. - type: list(string) - default: [] - required: false - - name: target_size - description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. - type: number - default: 1 - required: false - - name: update_policy - description: The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy - type: |- - list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string - })) - default: [] - required: false - - name: wait_for_instances - description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. - type: string - default: "false" - required: false - outputs: - - name: health_check_self_links - description: All self_links of healthchecks created for the instance group. - - name: instance_group - description: Instance-group url of managed instance group - - name: instance_group_manager - description: An instance of google_compute_region_instance_group_manager of the instance group. - - name: self_link - description: Self-link of managed instance group - roles: - - level: Project + info: + title: Managed Instance Group (MIG) + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + dir: /modules/mig + version: 9.0.0 + actuationTool: + flavor: Terraform + version: ">=0.13.0" + description: {} + content: + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags + interfaces: + variables: + - name: autoscaler_name + description: Autoscaler name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: autoscaling_cpu + description: "Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization" + varType: |- + list(object({ + target = number + predictive_method = string + })) + defaultValue: [] + - name: autoscaling_enabled + description: Creates an autoscaler for the managed instance group + varType: string + defaultValue: "false" + - name: autoscaling_lb + description: "Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization" + varType: list(map(number)) + defaultValue: [] + - name: autoscaling_metric + description: "Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric" + varType: |- + list(object({ + name = string + target = number + type = string + })) + defaultValue: [] + - name: autoscaling_mode + description: "Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode" + varType: string + defaultValue: null + - name: autoscaling_scale_in_control + description: "Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control" + varType: |- + object({ + fixed_replicas = number + percent_replicas = number + time_window_sec = number + }) + defaultValue: + fixed_replicas: null + percent_replicas: null + time_window_sec: null + - name: cooldown_period + description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. + varType: number + defaultValue: 60 + - name: distribution_policy_target_shape + description: MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE) + varType: string + defaultValue: null + - name: distribution_policy_zones + description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. + varType: list(string) + defaultValue: [] + - name: health_check + description: Health check to determine whether instances are responsive and able to do work + varType: |- + object({ + type = string + initial_delay_sec = number + check_interval_sec = number + healthy_threshold = number + timeout_sec = number + unhealthy_threshold = number + response = string + proxy_header = string + port = number + request = string + request_path = string + host = string + enable_logging = bool + }) + defaultValue: + check_interval_sec: 30 + enable_logging: false + healthy_threshold: 1 + host: "" + initial_delay_sec: 30 + port: 80 + proxy_header: NONE + request: "" + request_path: / + response: "" + timeout_sec: 10 + type: "" + unhealthy_threshold: 5 + - name: health_check_name + description: Health check name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: hostname + description: Hostname prefix for instances + varType: string + defaultValue: default + - name: instance_template + description: Instance template self_link used to create compute instances + varType: string + defaultValue: null + required: true + - name: max_replicas + description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. + varType: number + defaultValue: 10 + - name: mig_name + description: Managed instance group name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: mig_timeouts + description: Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. + varType: |- + object({ + create = string + update = string + delete = string + }) + defaultValue: + create: 5m + delete: 15m + update: 5m + - name: min_replicas + description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. + varType: number + defaultValue: 2 + - name: named_ports + description: "Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports" + varType: |- + list(object({ + name = string + port = number + })) + defaultValue: [] + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: The GCP region where the managed instance group resides. + varType: string + defaultValue: null + required: true + - name: scaling_schedules + description: "Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules" + varType: |- + list(object({ + disabled = bool + duration_sec = number + min_required_replicas = number + name = string + schedule = string + time_zone = string + })) + defaultValue: [] + - name: stateful_disks + description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs + varType: |- + list(object({ + device_name = string + delete_rule = string + })) + defaultValue: [] + - name: stateful_ips + description: Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs + varType: |- + list(object({ + interface_name = string + delete_rule = string + is_external = bool + })) + defaultValue: [] + - name: target_pools + description: The target load balancing pools to assign this group to. + varType: list(string) + defaultValue: [] + - name: target_size + description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. + varType: number + defaultValue: 1 + - name: update_policy + description: "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" + varType: |- + list(object({ + max_surge_fixed = number + instance_redistribution_type = string + max_surge_percent = number + max_unavailable_fixed = number + max_unavailable_percent = number + min_ready_sec = number + replacement_method = string + minimal_action = string + type = string + })) + defaultValue: [] + - name: wait_for_instances + description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. + varType: string + defaultValue: "false" + outputs: + - name: health_check_self_links + description: All self_links of healthchecks created for the instance group. + - name: instance_group + description: Instance-group url of managed instance group + - name: instance_group_manager + description: An instance of google_compute_region_instance_group_manager of the instance group. + - name: self_link + description: Self-link of managed instance group + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/mig_with_percent/metadata.yaml b/modules/mig_with_percent/metadata.yaml index eb4b0e68..20c3e5c4 100644 --- a/modules/mig_with_percent/metadata.yaml +++ b/modules/mig_with_percent/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,292 +15,295 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintMetadata metadata: - name: terraform-google-vm + name: terraform-google-vm-mig-with-percent annotations: config.kubernetes.io/local-config: "true" spec: - title: Managed Instance Group (MIG) with percent - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - version: 7.9.0 - actuationTool: - type: Terraform - version: '>=0.13.0' - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - variables: - - name: autoscaler_name - description: Autoscaler name. When variable is empty, name will be derived from var.hostname. - type: string - default: "" - required: false - - name: autoscaling_cpu - description: Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization - type: |- - list(object({ - target = number - predictive_method = string - })) - default: [] - required: false - - name: autoscaling_enabled - description: Creates an autoscaler for the managed instance group - type: string - default: "false" - required: false - - name: autoscaling_lb - description: Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization - type: list(map(number)) - default: [] - required: false - - name: autoscaling_metric - description: Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric - type: |- - list(object({ - name = string - target = number - type = string - })) - default: [] - required: false - - name: autoscaling_mode - description: Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode - type: string - required: false - - name: autoscaling_scale_in_control - description: Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control - type: |- - object({ - fixed_replicas = number - percent_replicas = number - time_window_sec = number - }) - default: - fixed_replicas: null - percent_replicas: null - time_window_sec: null - required: false - - name: cooldown_period - description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. - type: number - default: 60 - required: false - - name: distribution_policy_zones - description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. - type: list(string) - default: [] - required: false - - name: health_check - description: Health check to determine whether instances are responsive and able to do work - type: |- - object({ - type = string - initial_delay_sec = number - check_interval_sec = number - healthy_threshold = number - timeout_sec = number - unhealthy_threshold = number - response = string - proxy_header = string - port = number - request = string - request_path = string - host = string - enable_logging = bool - }) - default: - check_interval_sec: 30 - enable_logging: false - healthy_threshold: 1 - host: "" - initial_delay_sec: 30 - port: 80 - proxy_header: NONE - request: "" - request_path: / - response: "" - timeout_sec: 10 - type: "" - unhealthy_threshold: 5 - required: false - - name: health_check_name - description: Health check name. When variable is empty, name will be derived from var.hostname. - type: string - default: "" - required: false - - name: hostname - description: Hostname prefix for instances - type: string - default: default - required: false - - name: instance_template_initial_version - description: Instance template self_link used to create compute instances for the initial version - type: string - required: true - - name: instance_template_next_version - description: Instance template self_link used to create compute instances for the second version - type: string - required: true - - name: max_replicas - description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. - type: number - default: 10 - required: false - - name: mig_name - description: Managed instance group name. When variable is empty, name will be derived from var.hostname. - type: string - default: "" - required: false - - name: mig_timeouts - description: 'Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. ' - type: |- - object({ - create = string - update = string - delete = string - }) - default: - create: 5m - delete: 15m - update: 5m - required: false - - name: min_replicas - description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. - type: number - default: 2 - required: false - - name: named_ports - description: Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports - type: |- - list(object({ - name = string - port = number - })) - default: [] - required: false - - name: next_version_percent - description: Percentage of instances defined in the second version - type: number - required: true - - name: project_id - description: The GCP project ID - type: string - required: false - - name: region - description: The GCP region where the managed instance group resides. - type: string - required: true - - name: scaling_schedules - description: Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules - type: |- - list(object({ - disabled = bool - duration_sec = number - min_required_replicas = number - name = string - schedule = string - time_zone = string - })) - default: [] - required: false - - name: stateful_disks - description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs - type: |- - list(object({ - device_name = string - delete_rule = string - })) - default: [] - required: false - - name: target_pools - description: The target load balancing pools to assign this group to. - type: list(string) - default: [] - required: false - - name: target_size - description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. - type: number - default: 1 - required: false - - name: update_policy - description: The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy - type: |- - list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string - })) - default: [] - required: false - - name: wait_for_instances - description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. - type: string - default: "false" - required: false - outputs: - - name: health_check_self_links - description: All self_links of healthchecks created for the instance group. - - name: instance_group - description: Instance-group url of managed instance group - - name: instance_group_manager - description: An instance of google_compute_region_instance_group_manager of the instance group. - - name: self_link - description: Self-link of managed instance group - roles: - - level: Project + info: + title: Managed Instance Group (MIG) with percent + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + dir: /modules/mig_with_percent + version: 9.0.0 + actuationTool: + flavor: Terraform + version: ">=0.13.0" + description: {} + content: + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags + interfaces: + variables: + - name: autoscaler_name + description: Autoscaler name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: autoscaling_cpu + description: "Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization" + varType: |- + list(object({ + target = number + predictive_method = string + })) + defaultValue: [] + - name: autoscaling_enabled + description: Creates an autoscaler for the managed instance group + varType: string + defaultValue: "false" + - name: autoscaling_lb + description: "Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization" + varType: list(map(number)) + defaultValue: [] + - name: autoscaling_metric + description: "Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric" + varType: |- + list(object({ + name = string + target = number + type = string + })) + defaultValue: [] + - name: autoscaling_mode + description: "Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode" + varType: string + defaultValue: null + - name: autoscaling_scale_in_control + description: "Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control" + varType: |- + object({ + fixed_replicas = number + percent_replicas = number + time_window_sec = number + }) + defaultValue: + fixed_replicas: null + percent_replicas: null + time_window_sec: null + - name: cooldown_period + description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. + varType: number + defaultValue: 60 + - name: distribution_policy_target_shape + description: MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE) + varType: string + defaultValue: null + - name: distribution_policy_zones + description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. + varType: list(string) + defaultValue: [] + - name: health_check + description: Health check to determine whether instances are responsive and able to do work + varType: |- + object({ + type = string + initial_delay_sec = number + check_interval_sec = number + healthy_threshold = number + timeout_sec = number + unhealthy_threshold = number + response = string + proxy_header = string + port = number + request = string + request_path = string + host = string + enable_logging = bool + }) + defaultValue: + check_interval_sec: 30 + enable_logging: false + healthy_threshold: 1 + host: "" + initial_delay_sec: 30 + port: 80 + proxy_header: NONE + request: "" + request_path: / + response: "" + timeout_sec: 10 + type: "" + unhealthy_threshold: 5 + - name: health_check_name + description: Health check name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: hostname + description: Hostname prefix for instances + varType: string + defaultValue: default + - name: instance_template_initial_version + description: Instance template self_link used to create compute instances for the initial version + varType: string + defaultValue: null + required: true + - name: instance_template_next_version + description: Instance template self_link used to create compute instances for the second version + varType: string + defaultValue: null + required: true + - name: max_replicas + description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. + varType: number + defaultValue: 10 + - name: mig_name + description: Managed instance group name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: mig_timeouts + description: Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. + varType: |- + object({ + create = string + update = string + delete = string + }) + defaultValue: + create: 5m + delete: 15m + update: 5m + - name: min_replicas + description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. + varType: number + defaultValue: 2 + - name: named_ports + description: "Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports" + varType: |- + list(object({ + name = string + port = number + })) + defaultValue: [] + - name: next_version_percent + description: Percentage of instances defined in the second version + varType: number + defaultValue: null + required: true + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: The GCP region where the managed instance group resides. + varType: string + defaultValue: null + required: true + - name: scaling_schedules + description: "Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules" + varType: |- + list(object({ + disabled = bool + duration_sec = number + min_required_replicas = number + name = string + schedule = string + time_zone = string + })) + defaultValue: [] + - name: stateful_disks + description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs + varType: |- + list(object({ + device_name = string + delete_rule = string + })) + defaultValue: [] + - name: stateful_ips + description: Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs + varType: |- + list(object({ + interface_name = string + delete_rule = string + is_external = bool + })) + defaultValue: [] + - name: target_pools + description: The target load balancing pools to assign this group to. + varType: list(string) + defaultValue: [] + - name: target_size + description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. + varType: number + defaultValue: 1 + - name: update_policy + description: "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" + varType: |- + list(object({ + max_surge_fixed = number + instance_redistribution_type = string + max_surge_percent = number + max_unavailable_fixed = number + max_unavailable_percent = number + min_ready_sec = number + replacement_method = string + minimal_action = string + type = string + })) + defaultValue: [] + - name: wait_for_instances + description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. + varType: string + defaultValue: "false" + outputs: + - name: health_check_self_links + description: All self_links of healthchecks created for the instance group. + - name: instance_group + description: Instance-group url of managed instance group + - name: instance_group_manager + description: An instance of google_compute_region_instance_group_manager of the instance group. + - name: self_link + description: Self-link of managed instance group + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/preemptible_and_regular_instance_templates/metadata.yaml b/modules/preemptible_and_regular_instance_templates/metadata.yaml index 51c3dc83..b49814fd 100644 --- a/modules/preemptible_and_regular_instance_templates/metadata.yaml +++ b/modules/preemptible_and_regular_instance_templates/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,201 +15,191 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintMetadata metadata: - name: terraform-google-vm + name: terraform-google-vm-preemptible-and-regular-instance-templates annotations: config.kubernetes.io/local-config: "true" spec: - title: preemptible_and_regular_instance_templates - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - version: 7.9.0 - actuationTool: - type: Terraform - version: '>=0.13.0' - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - variables: - - name: 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 - network_tier = string - })) - default: [] - required: false - - name: additional_disks - description: List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name - type: |- - list(object({ - disk_name = string - device_name = string - auto_delete = bool - boot = bool - disk_size_gb = number - disk_type = string - disk_labels = map(string) - })) - default: [] - required: false - - name: auto_delete - description: Whether or not the boot disk should be auto-deleted - type: bool - default: true - required: false - - name: can_ip_forward - description: Enable IP forwarding, for NAT instances for example - type: string - default: "false" - required: false - - name: disk_size_gb - description: Boot disk size in GB - type: string - default: "100" - required: false - - name: disk_type - description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard - type: string - default: pd-standard - required: false - - 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. - type: |- - list(object({ - network_tier = string - })) - default: [] - required: false - - name: labels - description: Labels, provided as a map - type: map(string) - default: {} - required: false - - name: machine_type - description: Machine type to create, e.g. n1-standard-1 - type: string - default: n1-standard-1 - required: false - - name: metadata - description: Metadata, provided as a map - type: map(string) - default: {} - required: false - - name: name_prefix - description: Name prefix for the instance template - type: string - default: default-it - required: false - - name: network - description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. - type: string - default: "" - required: false - - name: project_id - description: The GCP project ID - type: string - required: false - - name: service_account - description: Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account. - type: |- - object({ - email = string - scopes = set(string) - }) - required: true - - name: source_image - description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - type: string - default: "" - required: false - - name: source_image_family - description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - type: string - default: "" - required: false - - name: source_image_project - description: Project where the source image comes from - type: string - default: "" - required: false - - name: startup_script - description: User startup script to run when instances spin up - type: string - default: "" - required: false - - name: subnetwork - description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. - type: string - default: "" - required: false - - name: subnetwork_project - description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. - type: string - default: "" - required: false - - name: tags - description: Network tags, provided as a list - type: list(string) - default: [] - required: false - outputs: - - name: preemptible_name - description: Name of preemptible instance template - - name: preemptible_self_link - description: Self-link of preemptible instance template - - name: regular_name - description: Name of regular instance template - - name: regular_self_link - description: Self-link of regular instance template - roles: - - level: Project + info: + title: preemptible_and_regular_instance_templates + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + dir: /modules/preemptible_and_regular_instance_templates + version: 9.0.0 + actuationTool: + flavor: Terraform + version: ">=0.13.0" + description: {} + content: + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags + interfaces: + variables: + - name: access_config + description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. + varType: |- + list(object({ + nat_ip = string + network_tier = string + })) + defaultValue: [] + - name: additional_disks + description: "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name" + varType: |- + list(object({ + disk_name = string + device_name = string + auto_delete = bool + boot = bool + disk_size_gb = number + disk_type = string + disk_labels = map(string) + })) + defaultValue: [] + - name: auto_delete + description: Whether or not the boot disk should be auto-deleted + varType: bool + defaultValue: true + - name: can_ip_forward + description: Enable IP forwarding, for NAT instances for example + varType: string + defaultValue: "false" + - name: disk_size_gb + description: Boot disk size in GB + varType: string + defaultValue: "100" + - name: disk_type + description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard + varType: string + defaultValue: pd-standard + - 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({ + network_tier = string + })) + defaultValue: [] + - name: labels + description: Labels, provided as a map + varType: map(string) + defaultValue: {} + - name: machine_type + description: Machine type to create, e.g. n1-standard-1 + varType: string + defaultValue: n1-standard-1 + - name: metadata + description: Metadata, provided as a map + varType: map(string) + defaultValue: {} + - name: name_prefix + description: Name prefix for the instance template + varType: string + defaultValue: default-it + - name: network + description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. + varType: string + defaultValue: "" + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: service_account + description: "Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account." + varType: |- + object({ + email = string + scopes = set(string) + }) + defaultValue: null + required: true + - name: source_image + description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: "" + - name: source_image_family + description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: "" + - name: source_image_project + description: Project where the source image comes from + varType: string + defaultValue: "" + - name: startup_script + description: User startup script to run when instances spin up + varType: string + defaultValue: "" + - name: subnetwork + description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. + varType: string + defaultValue: "" + - name: subnetwork_project + description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. + varType: string + defaultValue: "" + - name: tags + description: Network tags, provided as a list + varType: list(string) + defaultValue: [] + outputs: + - name: preemptible_name + description: Name of preemptible instance template + - name: preemptible_self_link + description: Self-link of preemptible instance template + - name: regular_name + description: Name of regular instance template + - name: regular_self_link + description: Self-link of regular instance template + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/umig/metadata.yaml b/modules/umig/metadata.yaml index bb394293..0c02d19c 100644 --- a/modules/umig/metadata.yaml +++ b/modules/umig/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,171 +15,174 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintMetadata metadata: - name: terraform-google-vm + name: terraform-google-vm-umig annotations: config.kubernetes.io/local-config: "true" spec: - title: Unmanaged Instance Group (UMIG) - source: - repo: https://github.com/terraform-google-modules/terraform-google-vm - sourceType: git - version: 7.9.0 - actuationTool: - type: Terraform - version: '>=0.13.0' - examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags - variables: - - name: access_config - description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. - type: |- - list(list(object({ - nat_ip = string - network_tier = string - }))) - default: [] - required: false - - name: additional_networks - description: Additional network interface details for GCE, if any. - type: |- - list(object({ - network = string - subnetwork = string - subnetwork_project = string - network_ip = string - access_config = list(object({ + info: + title: Unmanaged Instance Group (UMIG) + source: + repo: https://github.com/terraform-google-modules/terraform-google-vm + sourceType: git + dir: /modules/umig + version: 9.0.0 + actuationTool: + flavor: Terraform + version: ">=0.13.0" + description: {} + content: + examples: + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags + interfaces: + variables: + - name: access_config + description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. + varType: |- + list(list(object({ nat_ip = string network_tier = string + }))) + defaultValue: [] + - name: additional_networks + description: Additional network interface details for GCE, if any. + varType: |- + list(object({ + network = string + subnetwork = string + subnetwork_project = string + network_ip = string + access_config = list(object({ + nat_ip = string + network_tier = string + })) + ipv6_access_config = list(object({ + network_tier = string + })) })) - ipv6_access_config = list(object({ + defaultValue: [] + - name: hostname + description: Hostname of instances + 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 + defaultValue: null + 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. + varType: |- + list(list(object({ network_tier = string + }))) + defaultValue: [] + - name: named_ports + description: Named name and named port + varType: |- + list(object({ + name = string + port = number })) - })) - default: [] - required: false - - name: hostname - description: Hostname of instances - type: string - default: "" - required: false - - name: hostname_suffix_separator - description: Separator character to compose hostname when add_hostname_suffix is set to true. - type: string - default: '-' - required: false - - name: instance_template - description: Instance template self_link used to create compute instances - type: 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. - type: |- - list(list(object({ - network_tier = string - }))) - default: [] - required: false - - name: named_ports - description: Named name and named port - type: |- - list(object({ - name = string - port = number - })) - default: [] - required: false - - name: network - description: Network to deploy to. Only one of network or subnetwork should be specified. - type: string - default: "" - required: false - - name: num_instances - description: Number of instances to create. This value is ignored if static_ips is provided. - type: string - default: "1" - required: false - - name: project_id - description: The GCP project ID - type: string - required: false - - name: region - description: The GCP region where the unmanaged instance group resides. - type: string - required: true - - name: static_ips - description: List of static IPs for VM instances - type: list(string) - default: [] - required: false - - name: subnetwork - description: Subnet to deploy to. Only one of network or subnetwork should be specified. - type: string - default: "" - required: false - - name: subnetwork_project - description: The project that subnetwork belongs to - type: string - default: "" - required: false - outputs: - - name: available_zones - description: List of available zones in region - - name: instances_details - description: List of all details for compute instances - - name: instances_self_links - description: List of self-links for compute instances - - name: self_links - description: List of self-links for unmanaged instance groups - - name: umig_details - description: List of all details for unmanaged instance groups - roles: - - level: Project + defaultValue: [] + - 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: string + defaultValue: "1" + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: The GCP region where the unmanaged instance group resides. + varType: string + defaultValue: null + required: true + - 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: zones + description: (Optional) List of availability zones to create VM instances in + varType: list(string) + defaultValue: [] + outputs: + - name: available_zones + description: List of available zones in region + - name: instances_details + description: List of all details for compute instances + - name: instances_self_links + description: List of self-links for compute instances + - name: self_links + description: List of self-links for unmanaged instance groups + - name: umig_details + description: List of all details for unmanaged instance groups + requirements: roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin - services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin + services: + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com From a36f8c1fb147e9d5f204054de728cb26c58b18a4 Mon Sep 17 00:00:00 2001 From: Awais Malik Date: Wed, 20 Sep 2023 10:30:14 -0700 Subject: [PATCH 2/2] adding metadata files --- metadata.yaml | 132 ++--- modules/compute_disk_snapshot/metadata.yaml | 264 ++++----- modules/compute_instance/metadata.yaml | 276 ++++----- modules/instance_template/metadata.yaml | 547 +++++++++--------- modules/mig/metadata.yaml | 518 ++++++++--------- modules/mig_with_percent/metadata.yaml | 538 ++++++++--------- .../metadata.yaml | 330 +++++------ modules/umig/metadata.yaml | 286 ++++----- 8 files changed, 1447 insertions(+), 1444 deletions(-) diff --git a/metadata.yaml b/metadata.yaml index fee8281c..fb23294a 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -27,74 +27,74 @@ spec: description: {} content: subBlueprints: - - name: compute_disk_snapshot - location: modules/compute_disk_snapshot - - name: compute_instance - location: modules/compute_instance - - name: instance_template - location: modules/instance_template - - name: mig - location: modules/mig - - name: mig_with_percent - location: modules/mig_with_percent - - name: preemptible_and_regular_instance_templates - location: modules/preemptible_and_regular_instance_templates - - name: umig - location: modules/umig + - name: compute_disk_snapshot + location: modules/compute_disk_snapshot + - name: compute_instance + location: modules/compute_instance + - name: instance_template + location: modules/instance_template + - name: mig + location: modules/mig + - name: mig_with_percent + location: modules/mig_with_percent + - name: preemptible_and_regular_instance_templates + location: modules/preemptible_and_regular_instance_templates + - name: umig + location: modules/umig examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags interfaces: {} requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/compute_disk_snapshot/metadata.yaml b/modules/compute_disk_snapshot/metadata.yaml index d3b32b0b..b2c1cc7e 100644 --- a/modules/compute_disk_snapshot/metadata.yaml +++ b/modules/compute_disk_snapshot/metadata.yaml @@ -32,141 +32,141 @@ spec: description: {} content: examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + 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 - defaultValue: null - required: true - - name: project - description: The project ID where the resources will be created - varType: string - defaultValue: null - required: true - - name: region - description: Region where resource policy resides - varType: string - defaultValue: null - 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) - } - ) - defaultValue: null - - 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: |- - object( - { - max_retention_days = number - on_source_disk_delete = string - } - ) - defaultValue: null - required: true - - name: snapshot_schedule - description: "The scheduled to be used by the snapshot policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#schedule" - varType: |- - object( - { - daily_schedule = object( - { - days_in_cycle = number - start_time = string - } - ) - hourly_schedule = object( - { - hours_in_cycle = number - start_time = string - } - ) - weekly_schedule = object( - { - day_of_weeks = set(object( - { - day = string - start_time = string - } - )) - } - ) - } - ) - defaultValue: null - required: true + - 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 + defaultValue: null + required: true + - name: project + description: The project ID where the resources will be created + varType: string + defaultValue: null + required: true + - name: region + description: Region where resource policy resides + varType: string + defaultValue: null + 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) + } + ) + defaultValue: null + - 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: |- + object( + { + max_retention_days = number + on_source_disk_delete = string + } + ) + defaultValue: null + required: true + - name: snapshot_schedule + description: The scheduled to be used by the snapshot policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#schedule + varType: |- + object( + { + daily_schedule = object( + { + days_in_cycle = number + start_time = string + } + ) + hourly_schedule = object( + { + hours_in_cycle = number + start_time = string + } + ) + weekly_schedule = object( + { + day_of_weeks = set(object( + { + day = string + start_time = string + } + )) + } + ) + } + ) + defaultValue: null + required: true outputs: - - name: attachments - description: Disk attachments to the resource policy - - name: policy - description: Resource snapshot policy details + - name: attachments + description: Disk attachments to the resource policy + - name: policy + description: Resource snapshot policy details requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/compute_instance/metadata.yaml b/modules/compute_instance/metadata.yaml index 26cbd9de..7f14a5f0 100644 --- a/modules/compute_instance/metadata.yaml +++ b/modules/compute_instance/metadata.yaml @@ -32,147 +32,147 @@ spec: description: {} content: examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags interfaces: variables: - - name: access_config - description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. - varType: |- - list(object({ - nat_ip = string - 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. - varType: |- - list(object({ - ip_cidr_range = string - subnetwork_range_name = 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 - 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 - defaultValue: null - 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. - varType: |- - list(object({ - network_tier = string - })) - defaultValue: [] - - name: labels - description: (Optional) Labels to override those from the template, provided as a map - varType: map(string) - defaultValue: null - - 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 - defaultValue: null - - 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 - defaultValue: null + - name: access_config + description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. + varType: |- + list(object({ + nat_ip = string + 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. + varType: |- + list(object({ + ip_cidr_range = string + subnetwork_range_name = 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 + 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 + defaultValue: null + 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. + varType: |- + list(object({ + network_tier = string + })) + defaultValue: [] + - name: labels + description: (Optional) Labels to override those from the template, provided as a map + varType: map(string) + defaultValue: null + - 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 + defaultValue: null + - 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 + defaultValue: null outputs: - - name: available_zones - description: List of available zones in region - - name: instances_details - description: List of all details for compute instances - - name: instances_self_links - description: List of self-links for compute instances + - name: available_zones + description: List of available zones in region + - name: instances_details + description: List of all details for compute instances + - name: instances_self_links + description: List of self-links for compute instances requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/instance_template/metadata.yaml b/modules/instance_template/metadata.yaml index c4c71d33..559e672f 100644 --- a/modules/instance_template/metadata.yaml +++ b/modules/instance_template/metadata.yaml @@ -32,288 +32,291 @@ spec: description: {} content: examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags interfaces: variables: - - name: access_config - description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. - varType: |- - list(object({ - nat_ip = string - network_tier = string - })) - defaultValue: [] - - name: additional_disks - description: "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name" - varType: |- - list(object({ - disk_name = string - device_name = string - auto_delete = bool - boot = bool - disk_size_gb = number - disk_type = string - disk_labels = map(string) - })) - defaultValue: [] - - name: additional_networks - description: Additional network interface details for GCE, if any. - varType: |- - 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({ + - name: access_config + description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. + varType: |- + list(object({ nat_ip = string network_tier = string })) - ipv6_access_config = list(object({ - network_tier = string + defaultValue: [] + - name: additional_disks + description: List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name + varType: |- + list(object({ + disk_name = string + device_name = string + auto_delete = bool + boot = bool + disk_size_gb = number + disk_type = string + disk_labels = map(string) + })) + defaultValue: [] + - name: additional_networks + description: Additional network interface details for GCE, if any. + varType: |- + 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 + })) })) - alias_ip_range = list(object({ + defaultValue: [] + - name: alias_ip_range + description: | + 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. + varType: |- + object({ ip_cidr_range = string subnetwork_range_name = string + }) + defaultValue: null + - name: auto_delete + description: Whether or not the boot disk should be auto-deleted + varType: string + defaultValue: "true" + - name: automatic_restart + description: (Optional) Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). + varType: bool + defaultValue: true + - name: can_ip_forward + description: Enable IP forwarding, for NAT instances for example + varType: string + defaultValue: "false" + - name: disk_encryption_key + description: The id of the encryption key that is stored in Google Cloud KMS to use to encrypt all the disks on this instance + varType: string + defaultValue: null + - name: disk_labels + description: Labels to be assigned to boot disk, provided as a map + varType: map(string) + defaultValue: {} + - name: disk_size_gb + description: Boot disk size in GB + varType: string + defaultValue: "100" + - name: disk_type + description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard + varType: string + defaultValue: pd-standard + - name: enable_confidential_vm + description: Whether to enable the Confidential VM configuration on the instance. Note that the instance image must support Confidential VMs. See https://cloud.google.com/compute/docs/images + varType: bool + defaultValue: false + - name: enable_nested_virtualization + description: Defines whether the instance should have nested virtualization enabled. + varType: bool + defaultValue: false + - name: enable_shielded_vm + description: Whether to enable the Shielded VM configuration on the instance. Note that the instance image must support Shielded VMs. See https://cloud.google.com/compute/docs/images + varType: bool + defaultValue: false + - name: gpu + description: GPU information. Type and count of GPU to attach to the instance template. See https://cloud.google.com/compute/docs/gpus more details + varType: |- + object({ + type = string + count = number + }) + defaultValue: null + - 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({ + network_tier = string })) - })) - defaultValue: [] - - name: alias_ip_range - description: "An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.\nip_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.\nsubnetwork_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.\n" - varType: |- - object({ - ip_cidr_range = string - subnetwork_range_name = string - }) - defaultValue: null - - name: auto_delete - description: Whether or not the boot disk should be auto-deleted - varType: string - defaultValue: "true" - - name: automatic_restart - description: (Optional) Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). - varType: bool - defaultValue: true - - name: can_ip_forward - description: Enable IP forwarding, for NAT instances for example - varType: string - defaultValue: "false" - - name: disk_encryption_key - description: The id of the encryption key that is stored in Google Cloud KMS to use to encrypt all the disks on this instance - varType: string - defaultValue: null - - name: disk_labels - description: Labels to be assigned to boot disk, provided as a map - varType: map(string) - defaultValue: {} - - name: disk_size_gb - description: Boot disk size in GB - varType: string - defaultValue: "100" - - name: disk_type - description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard - varType: string - defaultValue: pd-standard - - name: enable_confidential_vm - description: Whether to enable the Confidential VM configuration on the instance. Note that the instance image must support Confidential VMs. See https://cloud.google.com/compute/docs/images - varType: bool - defaultValue: false - - name: enable_nested_virtualization - description: Defines whether the instance should have nested virtualization enabled. - varType: bool - defaultValue: false - - name: enable_shielded_vm - description: Whether to enable the Shielded VM configuration on the instance. Note that the instance image must support Shielded VMs. See https://cloud.google.com/compute/docs/images - varType: bool - defaultValue: false - - name: gpu - description: GPU information. Type and count of GPU to attach to the instance template. See https://cloud.google.com/compute/docs/gpus more details - varType: |- - object({ - type = string - count = number - }) - defaultValue: null - - 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({ - network_tier = string - })) - defaultValue: [] - - name: labels - description: Labels, provided as a map - varType: map(string) - defaultValue: {} - - name: machine_type - description: Machine type to create, e.g. n1-standard-1 - varType: string - defaultValue: n1-standard-1 - - name: metadata - description: Metadata, provided as a map - varType: map(string) - defaultValue: {} - - name: min_cpu_platform - description: "Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform" - varType: string - defaultValue: null - - name: name_prefix - description: Name prefix for the instance template - varType: string - defaultValue: default-instance-template - - name: network - description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. - varType: string - defaultValue: "" - - name: network_ip - description: Private IP address to assign to the instance if desired. - varType: string - defaultValue: "" - - name: nic_type - description: Valid values are "VIRTIO_NET", "GVNIC" or set to null to accept API default behavior. - varType: string - defaultValue: null - - name: on_host_maintenance - description: Instance availability Policy - varType: string - defaultValue: MIGRATE - - name: preemptible - description: Allow the instance to be preempted - varType: bool - defaultValue: false - - name: project_id - description: The GCP project ID - varType: string - defaultValue: null - - name: region - description: Region where the instance template should be created. - varType: string - defaultValue: null - - name: service_account - description: "Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account." - varType: |- - object({ - email = string - scopes = set(string) - }) - defaultValue: null - required: true - - name: shielded_instance_config - description: Not used unless enable_shielded_vm is true. Shielded VM configuration for the instance. - varType: |- - object({ - enable_secure_boot = bool - enable_vtpm = bool - enable_integrity_monitoring = bool - }) - defaultValue: - enable_integrity_monitoring: true - enable_secure_boot: true - enable_vtpm: true - - name: source_image - description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - varType: string - defaultValue: "" - - name: source_image_family - description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - varType: string - defaultValue: centos-7 - - name: source_image_project - description: Project where the source image comes from. The default project contains CentOS images. - varType: string - defaultValue: centos-cloud - - name: spot - description: Provision a SPOT instance - varType: bool - defaultValue: false - - name: stack_type - description: The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are `IPV4_IPV6` or `IPV4_ONLY`. Default behavior is equivalent to IPV4_ONLY. - varType: string - defaultValue: null - - name: startup_script - description: User startup script to run when instances spin up - varType: string - defaultValue: "" - - name: subnetwork - description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. - varType: string - defaultValue: "" - - name: subnetwork_project - description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. - varType: string - defaultValue: "" - - name: tags - description: Network tags, provided as a list - varType: list(string) - defaultValue: [] - - name: threads_per_core - description: The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. - varType: number - defaultValue: null - - name: total_egress_bandwidth_tier - description: Egress bandwidth tier setting for supported VM families - varType: string - defaultValue: DEFAULT + defaultValue: [] + - name: labels + description: Labels, provided as a map + varType: map(string) + defaultValue: {} + - name: machine_type + description: Machine type to create, e.g. n1-standard-1 + varType: string + defaultValue: n1-standard-1 + - name: metadata + description: Metadata, provided as a map + varType: map(string) + defaultValue: {} + - name: min_cpu_platform + description: "Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform" + varType: string + defaultValue: null + - name: name_prefix + description: Name prefix for the instance template + varType: string + defaultValue: default-instance-template + - name: network + description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. + varType: string + defaultValue: "" + - name: network_ip + description: Private IP address to assign to the instance if desired. + varType: string + defaultValue: "" + - name: nic_type + description: Valid values are "VIRTIO_NET", "GVNIC" or set to null to accept API default behavior. + varType: string + defaultValue: null + - name: on_host_maintenance + description: Instance availability Policy + varType: string + defaultValue: MIGRATE + - name: preemptible + description: Allow the instance to be preempted + varType: bool + defaultValue: false + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: Region where the instance template should be created. + varType: string + defaultValue: null + - name: service_account + description: Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account. + varType: |- + object({ + email = string + scopes = set(string) + }) + defaultValue: null + required: true + - name: shielded_instance_config + description: Not used unless enable_shielded_vm is true. Shielded VM configuration for the instance. + varType: |- + object({ + enable_secure_boot = bool + enable_vtpm = bool + enable_integrity_monitoring = bool + }) + defaultValue: + enable_integrity_monitoring: true + enable_secure_boot: true + enable_vtpm: true + - name: source_image + description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: "" + - name: source_image_family + description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: centos-7 + - name: source_image_project + description: Project where the source image comes from. The default project contains CentOS images. + varType: string + defaultValue: centos-cloud + - name: spot + description: Provision a SPOT instance + varType: bool + defaultValue: false + - name: stack_type + description: The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are `IPV4_IPV6` or `IPV4_ONLY`. Default behavior is equivalent to IPV4_ONLY. + varType: string + defaultValue: null + - name: startup_script + description: User startup script to run when instances spin up + varType: string + defaultValue: "" + - name: subnetwork + description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. + varType: string + defaultValue: "" + - name: subnetwork_project + description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. + varType: string + defaultValue: "" + - name: tags + description: Network tags, provided as a list + varType: list(string) + defaultValue: [] + - name: threads_per_core + description: The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. + varType: number + defaultValue: null + - name: total_egress_bandwidth_tier + description: Egress bandwidth tier setting for supported VM families + varType: string + defaultValue: DEFAULT outputs: - - name: name - description: Name of instance template - - name: self_link - description: Self-link of instance template - - name: tags - description: Tags that will be associated with instance(s) + - name: name + description: Name of instance template + - name: self_link + description: Self-link of instance template + - name: tags + description: Tags that will be associated with instance(s) requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/mig/metadata.yaml b/modules/mig/metadata.yaml index 1e92821f..beac0725 100644 --- a/modules/mig/metadata.yaml +++ b/modules/mig/metadata.yaml @@ -32,268 +32,268 @@ spec: description: {} content: examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags interfaces: variables: - - name: autoscaler_name - description: Autoscaler name. When variable is empty, name will be derived from var.hostname. - varType: string - defaultValue: "" - - name: autoscaling_cpu - description: "Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization" - varType: |- - list(object({ - target = number - predictive_method = string - })) - defaultValue: [] - - name: autoscaling_enabled - description: Creates an autoscaler for the managed instance group - varType: string - defaultValue: "false" - - name: autoscaling_lb - description: "Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization" - varType: list(map(number)) - defaultValue: [] - - name: autoscaling_metric - description: "Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric" - varType: |- - list(object({ - name = string - target = number - type = string - })) - defaultValue: [] - - name: autoscaling_mode - description: "Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode" - varType: string - defaultValue: null - - name: autoscaling_scale_in_control - description: "Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control" - varType: |- - object({ - fixed_replicas = number - percent_replicas = number - time_window_sec = number - }) - defaultValue: - fixed_replicas: null - percent_replicas: null - time_window_sec: null - - name: cooldown_period - description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. - varType: number - defaultValue: 60 - - name: distribution_policy_target_shape - description: MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE) - varType: string - defaultValue: null - - name: distribution_policy_zones - description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. - varType: list(string) - defaultValue: [] - - name: health_check - description: Health check to determine whether instances are responsive and able to do work - varType: |- - object({ - type = string - initial_delay_sec = number - check_interval_sec = number - healthy_threshold = number - timeout_sec = number - unhealthy_threshold = number - response = string - proxy_header = string - port = number - request = string - request_path = string - host = string - enable_logging = bool - }) - defaultValue: - check_interval_sec: 30 - enable_logging: false - healthy_threshold: 1 - host: "" - initial_delay_sec: 30 - port: 80 - proxy_header: NONE - request: "" - request_path: / - response: "" - timeout_sec: 10 - type: "" - unhealthy_threshold: 5 - - name: health_check_name - description: Health check name. When variable is empty, name will be derived from var.hostname. - varType: string - defaultValue: "" - - name: hostname - description: Hostname prefix for instances - varType: string - defaultValue: default - - name: instance_template - description: Instance template self_link used to create compute instances - varType: string - defaultValue: null - required: true - - name: max_replicas - description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. - varType: number - defaultValue: 10 - - name: mig_name - description: Managed instance group name. When variable is empty, name will be derived from var.hostname. - varType: string - defaultValue: "" - - name: mig_timeouts - description: Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. - varType: |- - object({ - create = string - update = string - delete = string - }) - defaultValue: - create: 5m - delete: 15m - update: 5m - - name: min_replicas - description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. - varType: number - defaultValue: 2 - - name: named_ports - description: "Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports" - varType: |- - list(object({ - name = string - port = number - })) - defaultValue: [] - - name: project_id - description: The GCP project ID - varType: string - defaultValue: null - - name: region - description: The GCP region where the managed instance group resides. - varType: string - defaultValue: null - required: true - - name: scaling_schedules - description: "Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules" - varType: |- - list(object({ - disabled = bool - duration_sec = number - min_required_replicas = number - name = string - schedule = string - time_zone = string - })) - defaultValue: [] - - name: stateful_disks - description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs - varType: |- - list(object({ - device_name = string - delete_rule = string - })) - defaultValue: [] - - name: stateful_ips - description: Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs - varType: |- - list(object({ - interface_name = string - delete_rule = string - is_external = bool - })) - defaultValue: [] - - name: target_pools - description: The target load balancing pools to assign this group to. - varType: list(string) - defaultValue: [] - - name: target_size - description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. - varType: number - defaultValue: 1 - - name: update_policy - description: "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" - varType: |- - list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string - })) - defaultValue: [] - - name: wait_for_instances - description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. - varType: string - defaultValue: "false" + - name: autoscaler_name + description: Autoscaler name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: autoscaling_cpu + description: Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization + varType: |- + list(object({ + target = number + predictive_method = string + })) + defaultValue: [] + - name: autoscaling_enabled + description: Creates an autoscaler for the managed instance group + varType: string + defaultValue: "false" + - name: autoscaling_lb + description: Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization + varType: list(map(number)) + defaultValue: [] + - name: autoscaling_metric + description: Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric + varType: |- + list(object({ + name = string + target = number + type = string + })) + defaultValue: [] + - name: autoscaling_mode + description: Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode + varType: string + defaultValue: null + - name: autoscaling_scale_in_control + description: Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control + varType: |- + object({ + fixed_replicas = number + percent_replicas = number + time_window_sec = number + }) + defaultValue: + fixed_replicas: null + percent_replicas: null + time_window_sec: null + - name: cooldown_period + description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. + varType: number + defaultValue: 60 + - name: distribution_policy_target_shape + description: MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE) + varType: string + defaultValue: null + - name: distribution_policy_zones + description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. + varType: list(string) + defaultValue: [] + - name: health_check + description: Health check to determine whether instances are responsive and able to do work + varType: |- + object({ + type = string + initial_delay_sec = number + check_interval_sec = number + healthy_threshold = number + timeout_sec = number + unhealthy_threshold = number + response = string + proxy_header = string + port = number + request = string + request_path = string + host = string + enable_logging = bool + }) + defaultValue: + check_interval_sec: 30 + enable_logging: false + healthy_threshold: 1 + host: "" + initial_delay_sec: 30 + port: 80 + proxy_header: NONE + request: "" + request_path: / + response: "" + timeout_sec: 10 + type: "" + unhealthy_threshold: 5 + - name: health_check_name + description: Health check name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: hostname + description: Hostname prefix for instances + varType: string + defaultValue: default + - name: instance_template + description: Instance template self_link used to create compute instances + varType: string + defaultValue: null + required: true + - name: max_replicas + description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. + varType: number + defaultValue: 10 + - name: mig_name + description: Managed instance group name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: mig_timeouts + description: "Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. " + varType: |- + object({ + create = string + update = string + delete = string + }) + defaultValue: + create: 5m + delete: 15m + update: 5m + - name: min_replicas + description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. + varType: number + defaultValue: 2 + - name: named_ports + description: Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports + varType: |- + list(object({ + name = string + port = number + })) + defaultValue: [] + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: The GCP region where the managed instance group resides. + varType: string + defaultValue: null + required: true + - name: scaling_schedules + description: Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules + varType: |- + list(object({ + disabled = bool + duration_sec = number + min_required_replicas = number + name = string + schedule = string + time_zone = string + })) + defaultValue: [] + - name: stateful_disks + description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs + varType: |- + list(object({ + device_name = string + delete_rule = string + })) + defaultValue: [] + - name: stateful_ips + description: Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs + varType: |- + list(object({ + interface_name = string + delete_rule = string + is_external = bool + })) + defaultValue: [] + - name: target_pools + description: The target load balancing pools to assign this group to. + varType: list(string) + defaultValue: [] + - name: target_size + description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. + varType: number + defaultValue: 1 + - name: update_policy + description: The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy + varType: |- + list(object({ + max_surge_fixed = number + instance_redistribution_type = string + max_surge_percent = number + max_unavailable_fixed = number + max_unavailable_percent = number + min_ready_sec = number + replacement_method = string + minimal_action = string + type = string + })) + defaultValue: [] + - name: wait_for_instances + description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. + varType: string + defaultValue: "false" outputs: - - name: health_check_self_links - description: All self_links of healthchecks created for the instance group. - - name: instance_group - description: Instance-group url of managed instance group - - name: instance_group_manager - description: An instance of google_compute_region_instance_group_manager of the instance group. - - name: self_link - description: Self-link of managed instance group + - name: health_check_self_links + description: All self_links of healthchecks created for the instance group. + - name: instance_group + description: Instance-group url of managed instance group + - name: instance_group_manager + description: An instance of google_compute_region_instance_group_manager of the instance group. + - name: self_link + description: Self-link of managed instance group requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/mig_with_percent/metadata.yaml b/modules/mig_with_percent/metadata.yaml index 20c3e5c4..baa8a88e 100644 --- a/modules/mig_with_percent/metadata.yaml +++ b/modules/mig_with_percent/metadata.yaml @@ -32,278 +32,278 @@ spec: description: {} content: examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags interfaces: variables: - - name: autoscaler_name - description: Autoscaler name. When variable is empty, name will be derived from var.hostname. - varType: string - defaultValue: "" - - name: autoscaling_cpu - description: "Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization" - varType: |- - list(object({ - target = number - predictive_method = string - })) - defaultValue: [] - - name: autoscaling_enabled - description: Creates an autoscaler for the managed instance group - varType: string - defaultValue: "false" - - name: autoscaling_lb - description: "Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization" - varType: list(map(number)) - defaultValue: [] - - name: autoscaling_metric - description: "Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric" - varType: |- - list(object({ - name = string - target = number - type = string - })) - defaultValue: [] - - name: autoscaling_mode - description: "Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode" - varType: string - defaultValue: null - - name: autoscaling_scale_in_control - description: "Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control" - varType: |- - object({ - fixed_replicas = number - percent_replicas = number - time_window_sec = number - }) - defaultValue: - fixed_replicas: null - percent_replicas: null - time_window_sec: null - - name: cooldown_period - description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. - varType: number - defaultValue: 60 - - name: distribution_policy_target_shape - description: MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE) - varType: string - defaultValue: null - - name: distribution_policy_zones - description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. - varType: list(string) - defaultValue: [] - - name: health_check - description: Health check to determine whether instances are responsive and able to do work - varType: |- - object({ - type = string - initial_delay_sec = number - check_interval_sec = number - healthy_threshold = number - timeout_sec = number - unhealthy_threshold = number - response = string - proxy_header = string - port = number - request = string - request_path = string - host = string - enable_logging = bool - }) - defaultValue: - check_interval_sec: 30 - enable_logging: false - healthy_threshold: 1 - host: "" - initial_delay_sec: 30 - port: 80 - proxy_header: NONE - request: "" - request_path: / - response: "" - timeout_sec: 10 - type: "" - unhealthy_threshold: 5 - - name: health_check_name - description: Health check name. When variable is empty, name will be derived from var.hostname. - varType: string - defaultValue: "" - - name: hostname - description: Hostname prefix for instances - varType: string - defaultValue: default - - name: instance_template_initial_version - description: Instance template self_link used to create compute instances for the initial version - varType: string - defaultValue: null - required: true - - name: instance_template_next_version - description: Instance template self_link used to create compute instances for the second version - varType: string - defaultValue: null - required: true - - name: max_replicas - description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. - varType: number - defaultValue: 10 - - name: mig_name - description: Managed instance group name. When variable is empty, name will be derived from var.hostname. - varType: string - defaultValue: "" - - name: mig_timeouts - description: Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. - varType: |- - object({ - create = string - update = string - delete = string - }) - defaultValue: - create: 5m - delete: 15m - update: 5m - - name: min_replicas - description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. - varType: number - defaultValue: 2 - - name: named_ports - description: "Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports" - varType: |- - list(object({ - name = string - port = number - })) - defaultValue: [] - - name: next_version_percent - description: Percentage of instances defined in the second version - varType: number - defaultValue: null - required: true - - name: project_id - description: The GCP project ID - varType: string - defaultValue: null - - name: region - description: The GCP region where the managed instance group resides. - varType: string - defaultValue: null - required: true - - name: scaling_schedules - description: "Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules" - varType: |- - list(object({ - disabled = bool - duration_sec = number - min_required_replicas = number - name = string - schedule = string - time_zone = string - })) - defaultValue: [] - - name: stateful_disks - description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs - varType: |- - list(object({ - device_name = string - delete_rule = string - })) - defaultValue: [] - - name: stateful_ips - description: Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs - varType: |- - list(object({ - interface_name = string - delete_rule = string - is_external = bool - })) - defaultValue: [] - - name: target_pools - description: The target load balancing pools to assign this group to. - varType: list(string) - defaultValue: [] - - name: target_size - description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. - varType: number - defaultValue: 1 - - name: update_policy - description: "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" - varType: |- - list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string - })) - defaultValue: [] - - name: wait_for_instances - description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. - varType: string - defaultValue: "false" + - name: autoscaler_name + description: Autoscaler name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: autoscaling_cpu + description: Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization + varType: |- + list(object({ + target = number + predictive_method = string + })) + defaultValue: [] + - name: autoscaling_enabled + description: Creates an autoscaler for the managed instance group + varType: string + defaultValue: "false" + - name: autoscaling_lb + description: Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization + varType: list(map(number)) + defaultValue: [] + - name: autoscaling_metric + description: Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric + varType: |- + list(object({ + name = string + target = number + type = string + })) + defaultValue: [] + - name: autoscaling_mode + description: Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode + varType: string + defaultValue: null + - name: autoscaling_scale_in_control + description: Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control + varType: |- + object({ + fixed_replicas = number + percent_replicas = number + time_window_sec = number + }) + defaultValue: + fixed_replicas: null + percent_replicas: null + time_window_sec: null + - name: cooldown_period + description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. + varType: number + defaultValue: 60 + - name: distribution_policy_target_shape + description: MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE) + varType: string + defaultValue: null + - name: distribution_policy_zones + description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. + varType: list(string) + defaultValue: [] + - name: health_check + description: Health check to determine whether instances are responsive and able to do work + varType: |- + object({ + type = string + initial_delay_sec = number + check_interval_sec = number + healthy_threshold = number + timeout_sec = number + unhealthy_threshold = number + response = string + proxy_header = string + port = number + request = string + request_path = string + host = string + enable_logging = bool + }) + defaultValue: + check_interval_sec: 30 + enable_logging: false + healthy_threshold: 1 + host: "" + initial_delay_sec: 30 + port: 80 + proxy_header: NONE + request: "" + request_path: / + response: "" + timeout_sec: 10 + type: "" + unhealthy_threshold: 5 + - name: health_check_name + description: Health check name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: hostname + description: Hostname prefix for instances + varType: string + defaultValue: default + - name: instance_template_initial_version + description: Instance template self_link used to create compute instances for the initial version + varType: string + defaultValue: null + required: true + - name: instance_template_next_version + description: Instance template self_link used to create compute instances for the second version + varType: string + defaultValue: null + required: true + - name: max_replicas + description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. + varType: number + defaultValue: 10 + - name: mig_name + description: Managed instance group name. When variable is empty, name will be derived from var.hostname. + varType: string + defaultValue: "" + - name: mig_timeouts + description: "Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. " + varType: |- + object({ + create = string + update = string + delete = string + }) + defaultValue: + create: 5m + delete: 15m + update: 5m + - name: min_replicas + description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. + varType: number + defaultValue: 2 + - name: named_ports + description: Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports + varType: |- + list(object({ + name = string + port = number + })) + defaultValue: [] + - name: next_version_percent + description: Percentage of instances defined in the second version + varType: number + defaultValue: null + required: true + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: The GCP region where the managed instance group resides. + varType: string + defaultValue: null + required: true + - name: scaling_schedules + description: Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules + varType: |- + list(object({ + disabled = bool + duration_sec = number + min_required_replicas = number + name = string + schedule = string + time_zone = string + })) + defaultValue: [] + - name: stateful_disks + description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs + varType: |- + list(object({ + device_name = string + delete_rule = string + })) + defaultValue: [] + - name: stateful_ips + description: Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs + varType: |- + list(object({ + interface_name = string + delete_rule = string + is_external = bool + })) + defaultValue: [] + - name: target_pools + description: The target load balancing pools to assign this group to. + varType: list(string) + defaultValue: [] + - name: target_size + description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. + varType: number + defaultValue: 1 + - name: update_policy + description: The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy + varType: |- + list(object({ + max_surge_fixed = number + instance_redistribution_type = string + max_surge_percent = number + max_unavailable_fixed = number + max_unavailable_percent = number + min_ready_sec = number + replacement_method = string + minimal_action = string + type = string + })) + defaultValue: [] + - name: wait_for_instances + description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. + varType: string + defaultValue: "false" outputs: - - name: health_check_self_links - description: All self_links of healthchecks created for the instance group. - - name: instance_group - description: Instance-group url of managed instance group - - name: instance_group_manager - description: An instance of google_compute_region_instance_group_manager of the instance group. - - name: self_link - description: Self-link of managed instance group + - name: health_check_self_links + description: All self_links of healthchecks created for the instance group. + - name: instance_group + description: Instance-group url of managed instance group + - name: instance_group_manager + description: An instance of google_compute_region_instance_group_manager of the instance group. + - name: self_link + description: Self-link of managed instance group requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/preemptible_and_regular_instance_templates/metadata.yaml b/modules/preemptible_and_regular_instance_templates/metadata.yaml index b49814fd..8e3a3033 100644 --- a/modules/preemptible_and_regular_instance_templates/metadata.yaml +++ b/modules/preemptible_and_regular_instance_templates/metadata.yaml @@ -32,174 +32,174 @@ spec: description: {} content: examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags interfaces: variables: - - name: access_config - description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. - varType: |- - list(object({ - nat_ip = string - network_tier = string - })) - defaultValue: [] - - name: additional_disks - description: "List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name" - varType: |- - list(object({ - disk_name = string - device_name = string - auto_delete = bool - boot = bool - disk_size_gb = number - disk_type = string - disk_labels = map(string) - })) - defaultValue: [] - - name: auto_delete - description: Whether or not the boot disk should be auto-deleted - varType: bool - defaultValue: true - - name: can_ip_forward - description: Enable IP forwarding, for NAT instances for example - varType: string - defaultValue: "false" - - name: disk_size_gb - description: Boot disk size in GB - varType: string - defaultValue: "100" - - name: disk_type - description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard - varType: string - defaultValue: pd-standard - - 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({ - network_tier = string - })) - defaultValue: [] - - name: labels - description: Labels, provided as a map - varType: map(string) - defaultValue: {} - - name: machine_type - description: Machine type to create, e.g. n1-standard-1 - varType: string - defaultValue: n1-standard-1 - - name: metadata - description: Metadata, provided as a map - varType: map(string) - defaultValue: {} - - name: name_prefix - description: Name prefix for the instance template - varType: string - defaultValue: default-it - - name: network - description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. - varType: string - defaultValue: "" - - name: project_id - description: The GCP project ID - varType: string - defaultValue: null - - name: service_account - description: "Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account." - varType: |- - object({ - email = string - scopes = set(string) - }) - defaultValue: null - required: true - - name: source_image - description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - varType: string - defaultValue: "" - - name: source_image_family - description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. - varType: string - defaultValue: "" - - name: source_image_project - description: Project where the source image comes from - varType: string - defaultValue: "" - - name: startup_script - description: User startup script to run when instances spin up - varType: string - defaultValue: "" - - name: subnetwork - description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. - varType: string - defaultValue: "" - - name: subnetwork_project - description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. - varType: string - defaultValue: "" - - name: tags - description: Network tags, provided as a list - 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: |- + list(object({ + nat_ip = string + network_tier = string + })) + defaultValue: [] + - name: additional_disks + description: List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name + varType: |- + list(object({ + disk_name = string + device_name = string + auto_delete = bool + boot = bool + disk_size_gb = number + disk_type = string + disk_labels = map(string) + })) + defaultValue: [] + - name: auto_delete + description: Whether or not the boot disk should be auto-deleted + varType: bool + defaultValue: true + - name: can_ip_forward + description: Enable IP forwarding, for NAT instances for example + varType: string + defaultValue: "false" + - name: disk_size_gb + description: Boot disk size in GB + varType: string + defaultValue: "100" + - name: disk_type + description: Boot disk type, can be either pd-ssd, local-ssd, or pd-standard + varType: string + defaultValue: pd-standard + - 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({ + network_tier = string + })) + defaultValue: [] + - name: labels + description: Labels, provided as a map + varType: map(string) + defaultValue: {} + - name: machine_type + description: Machine type to create, e.g. n1-standard-1 + varType: string + defaultValue: n1-standard-1 + - name: metadata + description: Metadata, provided as a map + varType: map(string) + defaultValue: {} + - name: name_prefix + description: Name prefix for the instance template + varType: string + defaultValue: default-it + - name: network + description: The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. + varType: string + defaultValue: "" + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: service_account + description: Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account. + varType: |- + object({ + email = string + scopes = set(string) + }) + defaultValue: null + required: true + - name: source_image + description: Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: "" + - name: source_image_family + description: Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. + varType: string + defaultValue: "" + - name: source_image_project + description: Project where the source image comes from + varType: string + defaultValue: "" + - name: startup_script + description: User startup script to run when instances spin up + varType: string + defaultValue: "" + - name: subnetwork + description: The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. + varType: string + defaultValue: "" + - name: subnetwork_project + description: The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. + varType: string + defaultValue: "" + - name: tags + description: Network tags, provided as a list + varType: list(string) + defaultValue: [] outputs: - - name: preemptible_name - description: Name of preemptible instance template - - name: preemptible_self_link - description: Self-link of preemptible instance template - - name: regular_name - description: Name of regular instance template - - name: regular_self_link - description: Self-link of regular instance template + - name: preemptible_name + description: Name of preemptible instance template + - name: preemptible_self_link + description: Self-link of preemptible instance template + - name: regular_name + description: Name of regular instance template + - name: regular_self_link + description: Self-link of regular instance template requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com diff --git a/modules/umig/metadata.yaml b/modules/umig/metadata.yaml index 0c02d19c..29942feb 100644 --- a/modules/umig/metadata.yaml +++ b/modules/umig/metadata.yaml @@ -32,157 +32,157 @@ spec: description: {} content: examples: - - name: additional_disks - location: examples/instance_template/additional_disks - - name: alias_ip_range - location: examples/instance_template/alias_ip_range - - name: autoscaler - location: examples/mig/autoscaler - - name: disk_snapshot - location: examples/compute_instance/disk_snapshot - - name: encrypted_disks - location: examples/instance_template/encrypted_disks - - name: full - location: examples/mig/full - - name: full - location: examples/umig/full - - name: healthcheck - location: examples/mig/healthcheck - - name: mig_stateful - location: examples/mig_stateful - - name: multiple_interfaces - location: examples/compute_instance/multiple_interfaces - - name: named_ports - location: examples/umig/named_ports - - name: next_hop - location: examples/compute_instance/next_hop - - name: simple - location: examples/compute_instance/simple - - name: simple - location: examples/instance_template/simple - - name: simple - location: examples/mig/simple - - name: simple - location: examples/mig_with_percent/simple - - name: simple - location: examples/preemptible_and_regular_instance_templates/simple - - name: simple - location: examples/umig/simple - - name: static_ips - location: examples/umig/static_ips - - name: tags - location: examples/compute_instance/tags + - name: additional_disks + location: examples/instance_template/additional_disks + - name: alias_ip_range + location: examples/instance_template/alias_ip_range + - name: autoscaler + location: examples/mig/autoscaler + - name: disk_snapshot + location: examples/compute_instance/disk_snapshot + - name: encrypted_disks + location: examples/instance_template/encrypted_disks + - name: full + location: examples/mig/full + - name: full + location: examples/umig/full + - name: healthcheck + location: examples/mig/healthcheck + - name: mig_stateful + location: examples/mig_stateful + - name: multiple_interfaces + location: examples/compute_instance/multiple_interfaces + - name: named_ports + location: examples/umig/named_ports + - name: next_hop + location: examples/compute_instance/next_hop + - name: simple + location: examples/compute_instance/simple + - name: simple + location: examples/instance_template/simple + - name: simple + location: examples/mig/simple + - name: simple + location: examples/mig_with_percent/simple + - name: simple + location: examples/preemptible_and_regular_instance_templates/simple + - name: simple + location: examples/umig/simple + - name: static_ips + location: examples/umig/static_ips + - name: tags + location: examples/compute_instance/tags interfaces: variables: - - name: access_config - description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. - varType: |- - list(list(object({ - nat_ip = string - network_tier = string - }))) - defaultValue: [] - - name: additional_networks - description: Additional network interface details for GCE, if any. - varType: |- - list(object({ - network = string - subnetwork = string - subnetwork_project = string - network_ip = string - access_config = list(object({ + - name: access_config + description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. + varType: |- + list(list(object({ nat_ip = string network_tier = string + }))) + defaultValue: [] + - name: additional_networks + description: Additional network interface details for GCE, if any. + varType: |- + list(object({ + network = string + subnetwork = string + subnetwork_project = string + network_ip = string + access_config = list(object({ + nat_ip = string + network_tier = string + })) + ipv6_access_config = list(object({ + network_tier = string + })) })) - ipv6_access_config = list(object({ + defaultValue: [] + - name: hostname + description: Hostname of instances + 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 + defaultValue: null + 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. + varType: |- + list(list(object({ network_tier = string + }))) + defaultValue: [] + - name: named_ports + description: Named name and named port + varType: |- + list(object({ + name = string + port = number })) - })) - defaultValue: [] - - name: hostname - description: Hostname of instances - 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 - defaultValue: null - 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. - varType: |- - list(list(object({ - network_tier = string - }))) - defaultValue: [] - - name: named_ports - description: Named name and named port - varType: |- - list(object({ - name = string - port = number - })) - defaultValue: [] - - 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: string - defaultValue: "1" - - name: project_id - description: The GCP project ID - varType: string - defaultValue: null - - name: region - description: The GCP region where the unmanaged instance group resides. - varType: string - defaultValue: null - required: true - - 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: zones - description: (Optional) List of availability zones to create VM instances in - varType: list(string) - defaultValue: [] + defaultValue: [] + - 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: string + defaultValue: "1" + - name: project_id + description: The GCP project ID + varType: string + defaultValue: null + - name: region + description: The GCP region where the unmanaged instance group resides. + varType: string + defaultValue: null + required: true + - 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: zones + description: (Optional) List of availability zones to create VM instances in + varType: list(string) + defaultValue: [] outputs: - - name: available_zones - description: List of available zones in region - - name: instances_details - description: List of all details for compute instances - - name: instances_self_links - description: List of self-links for compute instances - - name: self_links - description: List of self-links for unmanaged instance groups - - name: umig_details - description: List of all details for unmanaged instance groups + - name: available_zones + description: List of available zones in region + - name: instances_details + description: List of all details for compute instances + - name: instances_self_links + description: List of self-links for compute instances + - name: self_links + description: List of self-links for unmanaged instance groups + - name: umig_details + description: List of all details for unmanaged instance groups requirements: roles: - - level: Project - roles: - - roles/owner - - roles/compute.admin - - roles/compute.networkAdmin - - roles/iam.serviceAccountUser - - roles/compute.instanceAdmin + - level: Project + roles: + - roles/owner + - roles/compute.admin + - roles/compute.networkAdmin + - roles/iam.serviceAccountUser + - roles/compute.instanceAdmin services: - - cloudresourcemanager.googleapis.com - - storage-api.googleapis.com - - serviceusage.googleapis.com - - compute.googleapis.com - - iam.googleapis.com + - cloudresourcemanager.googleapis.com + - storage-api.googleapis.com + - serviceusage.googleapis.com + - compute.googleapis.com + - iam.googleapis.com