This module is used to create a google_compute_region_instance_group_manager, and optionally, an autoscaler and healthchecks.
See the simple example for a usage example.
The current version is 2.X. The following guides are available to assist with upgrades:
Name | Description | Type | Default | Required |
---|---|---|---|---|
autoscaler_name | Autoscaler name. When variable is empty, name will be derived from var.hostname. | string |
"" |
no |
autoscaling_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization | list(object({ |
[] |
no |
autoscaling_enabled | Creates an autoscaler for the managed instance group | string |
"false" |
no |
autoscaling_lb | Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization | list(map(number)) |
[] |
no |
autoscaling_metric | Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric | list(object({ |
[] |
no |
autoscaling_mode | 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 | string |
null |
no |
autoscaling_scale_in_control | Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control | object({ |
{ |
no |
cooldown_period | The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. | number |
60 |
no |
distribution_policy_target_shape | MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE) | string |
null |
no |
distribution_policy_zones | The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region. | list(string) |
[] |
no |
health_check | Health check to determine whether instances are responsive and able to do work | object({ |
{ |
no |
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({ |
{ |
no |
min_replicas | The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. | number |
2 |
no |
named_ports | Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports | list(object({ |
[] |
no |
project_id | The Google Cloud project ID | string |
null |
no |
region | The Google Cloud region where the managed instance group resides. | string |
n/a | yes |
scaling_schedules | Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules | list(object({ |
[] |
no |
stateful_disks | 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 | list(object({ |
[] |
no |
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 | 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 | 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 |
Name | Description |
---|---|
health_check_self_links | All self_links of healthchecks created for the instance group. |
instance_group | Instance-group url of managed instance group |
instance_group_manager | An instance of google_compute_region_instance_group_manager of the instance group. |
self_link | Self-link of managed instance group |