Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Managed Instance Group (MIG)

This module is used to create a google_compute_region_instance_group_manager, and optionally, an autoscaler and healthchecks.

Usage

See the simple example for a usage example.

Upgrading

The current version is 2.X. The following guides are available to assist with upgrades:

Inputs

Name Description Type Default Required
autoscaling_cpu Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization list(map(number)) <list> 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.html#load_balancing_utilization list(map(number)) <list> no
autoscaling_metric Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#metric object <list> no
cooldown_period The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. string "60" 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) <list> no
health_check Health check to determine whether instances are responsive and able to do work object <map> no
hostname Hostname prefix for instances string "default" no
instance_template Instance template self_link used to create compute instances string n/a yes
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. string "10" 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 <map> no
min_replicas The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. string "2" no
named_ports Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports object <list> no
network Network to deploy to. Only one of network or subnetwork should be specified. string "" no
project_id The GCP project ID string "null" no
region The GCP region where the managed instance group resides. string n/a yes
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 object <list> no
subnetwork Subnet to deploy to. Only one of network or subnetwork should be specified. string "" no
subnetwork_project The project that subnetwork belongs to string "" no
target_pools The target load balancing pools to assign this group to. list(string) <list> 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. string "1" no
update_policy The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager.html#rolling_update_policy object <list> 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

Name Description
instance_group Instance-group url of managed instance group
name Managed instance group name
self_link Self-link of managed instance group