From a36f8c1fb147e9d5f204054de728cb26c58b18a4 Mon Sep 17 00:00:00 2001 From: Awais Malik Date: Wed, 20 Sep 2023 10:30:14 -0700 Subject: [PATCH] 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