diff --git a/autogen/main.tf.tmpl b/autogen/main.tf.tmpl index a2755bcb..787fccbf 100644 --- a/autogen/main.tf.tmpl +++ b/autogen/main.tf.tmpl @@ -108,18 +108,23 @@ resource "google_compute_region_instance_group_manager" "{{ module_name }}" { dynamic "update_policy" { for_each = var.update_policy content { - instance_redistribution_type = lookup(update_policy.value, "instance_redistribution_type", null) - max_surge_fixed = lookup(update_policy.value, "max_surge_fixed", null) - max_surge_percent = lookup(update_policy.value, "max_surge_percent", null) - max_unavailable_fixed = lookup(update_policy.value, "max_unavailable_fixed", null) - max_unavailable_percent = lookup(update_policy.value, "max_unavailable_percent", null) - min_ready_sec = lookup(update_policy.value, "min_ready_sec", null) - replacement_method = lookup(update_policy.value, "replacement_method", null) - minimal_action = update_policy.value.minimal_action - type = update_policy.value.type + instance_redistribution_type = lookup(update_policy.value, "instance_redistribution_type", null) + max_surge_fixed = lookup(update_policy.value, "max_surge_fixed", null) + max_surge_percent = lookup(update_policy.value, "max_surge_percent", null) + max_unavailable_fixed = lookup(update_policy.value, "max_unavailable_fixed", null) + max_unavailable_percent = lookup(update_policy.value, "max_unavailable_percent", null) + min_ready_sec = lookup(update_policy.value, "min_ready_sec", null) + replacement_method = lookup(update_policy.value, "replacement_method", null) + most_disruptive_allowed_action = lookup(update_policy.value, "most_disruptive_allowed_action", null) + minimal_action = update_policy.value.minimal_action + type = update_policy.value.type } } + all_instances_config { + labels = var.labels + } + lifecycle { create_before_destroy = true ignore_changes = [distribution_policy_zones] diff --git a/autogen/variables.tf.tmpl b/autogen/variables.tf.tmpl index 6363798b..7589746a 100644 --- a/autogen/variables.tf.tmpl +++ b/autogen/variables.tf.tmpl @@ -118,15 +118,16 @@ variable "stateful_ips" { variable "update_policy" { description = "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" type = list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string + 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 + most_disruptive_allowed_action = string })) default = [] } @@ -296,3 +297,9 @@ variable "mig_timeouts" { delete = "15m" } } + +variable "labels" { + type = map(string) + description = "Labels, provided as a map" + default = {} +} diff --git a/examples/mig/full/variables.tf b/examples/mig/full/variables.tf index e89f681c..fb875961 100644 --- a/examples/mig/full/variables.tf +++ b/examples/mig/full/variables.tf @@ -169,15 +169,16 @@ variable "distribution_policy_zones" { variable "update_policy" { description = "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" type = list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string + 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 + most_disruptive_allowed_action = string })) default = [] } diff --git a/examples/mig_stateful/main.tf b/examples/mig_stateful/main.tf index 7c9ac788..3910dfd8 100644 --- a/examples/mig_stateful/main.tf +++ b/examples/mig_stateful/main.tf @@ -69,14 +69,15 @@ module "mig" { }] update_policy = [{ - max_surge_fixed = 0 - instance_redistribution_type = "NONE" - max_surge_percent = null - max_unavailable_fixed = 4 - max_unavailable_percent = null - min_ready_sec = 180 - replacement_method = "RECREATE" - minimal_action = "REFRESH" - type = "OPPORTUNISTIC" + max_surge_fixed = 0 + instance_redistribution_type = "NONE" + max_surge_percent = null + max_unavailable_fixed = 4 + max_unavailable_percent = null + min_ready_sec = 180 + replacement_method = "RECREATE" + minimal_action = "REFRESH" + type = "OPPORTUNISTIC" + most_disruptive_allowed_action = "REFRESH" }] } diff --git a/metadata.yaml b/metadata.yaml index fb23294a..20a33f59 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/modules/compute_disk_snapshot/metadata.yaml b/modules/compute_disk_snapshot/metadata.yaml index e4b13cfc..71517e5c 100644 --- a/modules/compute_disk_snapshot/metadata.yaml +++ b/modules/compute_disk_snapshot/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -85,17 +85,14 @@ spec: - 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 @@ -107,7 +104,6 @@ spec: 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: |- @@ -117,7 +113,6 @@ spec: 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 @@ -148,7 +143,6 @@ spec: ) } ) - defaultValue: null required: true outputs: - name: attachments diff --git a/modules/compute_instance/metadata.yaml b/modules/compute_instance/metadata.yaml index f51e1e43..b6cc76f5 100644 --- a/modules/compute_instance/metadata.yaml +++ b/modules/compute_instance/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -109,7 +109,6 @@ spec: - 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. @@ -121,7 +120,6 @@ spec: - 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 @@ -133,11 +131,9 @@ spec: - name: region description: Region where the instances should be created. varType: string - defaultValue: null - name: resource_manager_tags description: (Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource. varType: map(string) - 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) @@ -157,7 +153,6 @@ spec: - 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 diff --git a/modules/instance_template/metadata.yaml b/modules/instance_template/metadata.yaml index edc819c6..a0f27de8 100644 --- a/modules/instance_template/metadata.yaml +++ b/modules/instance_template/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -130,7 +130,6 @@ spec: 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 @@ -146,7 +145,6 @@ spec: - 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) @@ -178,7 +176,6 @@ spec: 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: |- @@ -197,7 +194,6 @@ spec: - name: maintenance_interval description: Specifies the frequency of planned maintenance events varType: string - defaultValue: null - name: metadata description: Metadata, provided as a map varType: map(string) @@ -205,7 +201,6 @@ spec: - 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 @@ -221,7 +216,6 @@ spec: - 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 @@ -233,11 +227,9 @@ spec: - 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: resource_policies description: A list of 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) @@ -249,7 +241,6 @@ spec: 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. @@ -286,7 +277,6 @@ spec: - 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 @@ -306,7 +296,6 @@ spec: - 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 diff --git a/modules/mig/README.md b/modules/mig/README.md index 4d5aeab9..216bcaa3 100644 --- a/modules/mig/README.md +++ b/modules/mig/README.md @@ -32,6 +32,7 @@ The current version is 2.X. The following guides are available to assist with up | health\_check\_name | Health check name. When variable is empty, name will be derived from var.hostname. | `string` | `""` | no | | hostname | Hostname prefix for instances | `string` | `"default"` | no | | instance\_template | Instance template self\_link used to create compute instances | `string` | n/a | yes | +| labels | Labels, provided as a map | `map(string)` | `{}` | no | | max\_replicas | 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. | `number` | `10` | no | | mig\_name | Managed instance group name. When variable is empty, name will be derived from var.hostname. | `string` | `""` | no | | mig\_timeouts | Times for creation, deleting and updating the MIG resources. Can be helpful when using wait\_for\_instances to allow a longer VM startup time. |
object({|
create = string
update = string
delete = string
})
{| no | @@ -44,7 +45,7 @@ The current version is 2.X. The following guides are available to assist with up | stateful\_ips | 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 |
"create": "5m",
"delete": "15m",
"update": "5m"
}
list(object({| `[]` | no | | target\_pools | The target load balancing pools to assign this group to. | `list(string)` | `[]` | no | | target\_size | 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. | `number` | `1` | no | -| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
interface_name = string
delete_rule = string
is_external = bool
}))
list(object({| `[]` | no | +| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
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
}))
list(object({| `[]` | no | | wait\_for\_instances | 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. | `string` | `"false"` | no | ## Outputs diff --git a/modules/mig/main.tf b/modules/mig/main.tf index f2515068..2b3e2696 100644 --- a/modules/mig/main.tf +++ b/modules/mig/main.tf @@ -92,18 +92,23 @@ resource "google_compute_region_instance_group_manager" "mig" { dynamic "update_policy" { for_each = var.update_policy content { - instance_redistribution_type = lookup(update_policy.value, "instance_redistribution_type", null) - max_surge_fixed = lookup(update_policy.value, "max_surge_fixed", null) - max_surge_percent = lookup(update_policy.value, "max_surge_percent", null) - max_unavailable_fixed = lookup(update_policy.value, "max_unavailable_fixed", null) - max_unavailable_percent = lookup(update_policy.value, "max_unavailable_percent", null) - min_ready_sec = lookup(update_policy.value, "min_ready_sec", null) - replacement_method = lookup(update_policy.value, "replacement_method", null) - minimal_action = update_policy.value.minimal_action - type = update_policy.value.type + instance_redistribution_type = lookup(update_policy.value, "instance_redistribution_type", null) + max_surge_fixed = lookup(update_policy.value, "max_surge_fixed", null) + max_surge_percent = lookup(update_policy.value, "max_surge_percent", null) + max_unavailable_fixed = lookup(update_policy.value, "max_unavailable_fixed", null) + max_unavailable_percent = lookup(update_policy.value, "max_unavailable_percent", null) + min_ready_sec = lookup(update_policy.value, "min_ready_sec", null) + replacement_method = lookup(update_policy.value, "replacement_method", null) + most_disruptive_allowed_action = lookup(update_policy.value, "most_disruptive_allowed_action", null) + minimal_action = update_policy.value.minimal_action + type = update_policy.value.type } } + all_instances_config { + labels = var.labels + } + lifecycle { create_before_destroy = true ignore_changes = [distribution_policy_zones] diff --git a/modules/mig/metadata.yaml b/modules/mig/metadata.yaml index c556d88e..bc0c257e 100644 --- a/modules/mig/metadata.yaml +++ b/modules/mig/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -106,7 +106,6 @@ spec: - 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: |- @@ -126,7 +125,6 @@ spec: - 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) @@ -174,8 +172,11 @@ spec: - name: instance_template description: Instance template self_link used to create compute instances varType: string - defaultValue: null required: true + - name: labels + description: Labels, provided as a map + varType: map(string) + defaultValue: {} - 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 @@ -211,11 +212,9 @@ spec: - 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 @@ -258,15 +257,16 @@ spec: 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 + 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 + most_disruptive_allowed_action = string })) defaultValue: [] - name: wait_for_instances diff --git a/modules/mig/variables.tf b/modules/mig/variables.tf index 767bb51f..e440ee2e 100644 --- a/modules/mig/variables.tf +++ b/modules/mig/variables.tf @@ -100,15 +100,16 @@ variable "stateful_ips" { variable "update_policy" { description = "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" type = list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string + 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 + most_disruptive_allowed_action = string })) default = [] } @@ -278,3 +279,9 @@ variable "mig_timeouts" { delete = "15m" } } + +variable "labels" { + type = map(string) + description = "Labels, provided as a map" + default = {} +} diff --git a/modules/mig_with_percent/README.md b/modules/mig_with_percent/README.md index 08ba215f..5e10aec7 100644 --- a/modules/mig_with_percent/README.md +++ b/modules/mig_with_percent/README.md @@ -32,6 +32,7 @@ The current version is 2.X. The following guides are available to assist with up | hostname | Hostname prefix for instances | `string` | `"default"` | no | | instance\_template\_initial\_version | Instance template self\_link used to create compute instances for the initial version | `string` | n/a | yes | | instance\_template\_next\_version | Instance template self\_link used to create compute instances for the second version | `string` | n/a | yes | +| labels | Labels, provided as a map | `map(string)` | `{}` | no | | max\_replicas | 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. | `number` | `10` | no | | mig\_name | Managed instance group name. When variable is empty, name will be derived from var.hostname. | `string` | `""` | no | | mig\_timeouts | Times for creation, deleting and updating the MIG resources. Can be helpful when using wait\_for\_instances to allow a longer VM startup time. |
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
most_disruptive_allowed_action = string
}))
object({|
create = string
update = string
delete = string
})
{| no | @@ -45,7 +46,7 @@ The current version is 2.X. The following guides are available to assist with up | stateful\_ips | 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 |
"create": "5m",
"delete": "15m",
"update": "5m"
}
list(object({| `[]` | no | | target\_pools | The target load balancing pools to assign this group to. | `list(string)` | `[]` | no | | target\_size | 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. | `number` | `1` | no | -| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
interface_name = string
delete_rule = string
is_external = bool
}))
list(object({| `[]` | no | +| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
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
}))
list(object({| `[]` | no | | wait\_for\_instances | 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. | `string` | `"false"` | no | ## Outputs diff --git a/modules/mig_with_percent/main.tf b/modules/mig_with_percent/main.tf index bd0a4490..e70649c5 100644 --- a/modules/mig_with_percent/main.tf +++ b/modules/mig_with_percent/main.tf @@ -101,18 +101,23 @@ resource "google_compute_region_instance_group_manager" "mig_with_percent" { dynamic "update_policy" { for_each = var.update_policy content { - instance_redistribution_type = lookup(update_policy.value, "instance_redistribution_type", null) - max_surge_fixed = lookup(update_policy.value, "max_surge_fixed", null) - max_surge_percent = lookup(update_policy.value, "max_surge_percent", null) - max_unavailable_fixed = lookup(update_policy.value, "max_unavailable_fixed", null) - max_unavailable_percent = lookup(update_policy.value, "max_unavailable_percent", null) - min_ready_sec = lookup(update_policy.value, "min_ready_sec", null) - replacement_method = lookup(update_policy.value, "replacement_method", null) - minimal_action = update_policy.value.minimal_action - type = update_policy.value.type + instance_redistribution_type = lookup(update_policy.value, "instance_redistribution_type", null) + max_surge_fixed = lookup(update_policy.value, "max_surge_fixed", null) + max_surge_percent = lookup(update_policy.value, "max_surge_percent", null) + max_unavailable_fixed = lookup(update_policy.value, "max_unavailable_fixed", null) + max_unavailable_percent = lookup(update_policy.value, "max_unavailable_percent", null) + min_ready_sec = lookup(update_policy.value, "min_ready_sec", null) + replacement_method = lookup(update_policy.value, "replacement_method", null) + most_disruptive_allowed_action = lookup(update_policy.value, "most_disruptive_allowed_action", null) + minimal_action = update_policy.value.minimal_action + type = update_policy.value.type } } + all_instances_config { + labels = var.labels + } + lifecycle { create_before_destroy = true ignore_changes = [distribution_policy_zones] diff --git a/modules/mig_with_percent/metadata.yaml b/modules/mig_with_percent/metadata.yaml index 5dd61ac7..01e4aff9 100644 --- a/modules/mig_with_percent/metadata.yaml +++ b/modules/mig_with_percent/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -106,7 +106,6 @@ spec: - 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: |- @@ -126,7 +125,6 @@ spec: - 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) @@ -174,13 +172,15 @@ spec: - 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: labels + description: Labels, provided as a map + varType: map(string) + defaultValue: {} - 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 @@ -216,16 +216,13 @@ spec: - 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 @@ -268,15 +265,16 @@ spec: 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 + 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 + most_disruptive_allowed_action = string })) defaultValue: [] - name: wait_for_instances diff --git a/modules/mig_with_percent/variables.tf b/modules/mig_with_percent/variables.tf index e6f6268d..759cd9de 100644 --- a/modules/mig_with_percent/variables.tf +++ b/modules/mig_with_percent/variables.tf @@ -110,15 +110,16 @@ variable "stateful_ips" { variable "update_policy" { description = "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" type = list(object({ - max_surge_fixed = number - instance_redistribution_type = string - max_surge_percent = number - max_unavailable_fixed = number - max_unavailable_percent = number - min_ready_sec = number - replacement_method = string - minimal_action = string - type = string + 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 + most_disruptive_allowed_action = string })) default = [] } @@ -288,3 +289,9 @@ variable "mig_timeouts" { delete = "15m" } } + +variable "labels" { + type = map(string) + description = "Labels, provided as a map" + default = {} +} diff --git a/modules/preemptible_and_regular_instance_templates/metadata.yaml b/modules/preemptible_and_regular_instance_templates/metadata.yaml index 57a0637e..36f0e0a2 100644 --- a/modules/preemptible_and_regular_instance_templates/metadata.yaml +++ b/modules/preemptible_and_regular_instance_templates/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -141,7 +141,6 @@ spec: - 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: |- @@ -149,7 +148,6 @@ spec: 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 Rocky Linux 9 optimized for GCP image. diff --git a/modules/umig/metadata.yaml b/modules/umig/metadata.yaml index 04c0c818..74d26419 100644 --- a/modules/umig/metadata.yaml +++ b/modules/umig/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -110,7 +110,6 @@ spec: - 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. @@ -138,11 +137,9 @@ spec: - 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
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
most_disruptive_allowed_action = string
}))