Configure a Compute Engine MIG

In Application Design Center, you can configure a Compute Engine managed instance group (MIG) to manage a collection of VM instances as a single entity with load balancing, autoscaling, and autohealing. You can customize the MIG for your specific component connections and configuration parameters. The configuration parameters are listed in the terraform-google-vm Terraform module on GitHub.

Component connections

The following table includes the components that you can connect to a Compute Engine MIG, and the resulting updates to your application and its generated Terraform code.

Connected component Application updates Background information

Global Cloud Load Balancing backend

  • The load balancer can distribute incoming traffic to the Compute Engine MIG.
  • The Compute Engine MIG is added to the Cloud Load Balancing backend service groups field.
Set up a classic Application Load Balancer with a managed instance group backend

Regional Cloud Load Balancing backend

  • The load balancer can distribute incoming traffic to the Compute Engine MIG.
  • The Compute Engine MIG is added to the Cloud Load Balancing backend service groups field.
Set up a regional external Application Load Balancer with VM instance group backends

Compute Engine instance template

  • The Compute Engine instance template is used to create instances in the managed instance group.
  • The instance template self link is added to the Compute Engine MIG.
Basic scenarios for creating managed instance groups (MIGs)

Required configuration parameters

If your template includes a Compute Engine MIG component, you must configure the following parameters before you deploy.

Parameter name Description and constraints Background information

Project ID

The project where you want to create the Compute Engine MIG.

Configure components

Region

region About Regional MIGs

Instance Template

instanceTemplate About Instance Templates

Optional configuration parameters

The following parameters are optional. To display advanced parameters, in the Configuration area, select Show advanced fields.

Feature Parameter name Description and constraint information Background information

MIG Name

name mig_name

Hostname

Hostname prefix for instances.

hostname

Target Size

targetSize Create a MIG with autoscaling enabled

Max Replicas

autoscalingPolicy.maxNumReplicas Create a MIG with autoscaling enabled

Min Replicas

autoscalingPolicy.minNumReplicas Create a MIG with autoscaling enabled

Autoscaling Mode

autoscalingPolicy.mode Autoscaling mode

Target Pools

targetPools[] Add a managed instance group to a target pool

Distribution Policy Target Shape

distributionPolicy.targetShape Regional MIG target distribution shape

Distribution Policy Zones

distributionPolicy.zones[] Set a target distribution shape for VMs in a regional MIG
Stateful Disks

Device Name

statefulPolicy.preservedState.disks[] Configuring stateful persistent disks in MIGs
Stateful Disks

Delete Rule

statefulPolicy.preservedState.disks[].autoDelete Configuring stateful persistent disks in MIGs
Stateful IPs

Interface Name

statefulPolicy.preservedState.internalIPs[] Configuring stateful IP addresses in MIGs
Stateful IPs

Delete Rule

statefulPolicy.preservedState.internalIPs[].autoDelete Configuring stateful IP addresses in MIGs
Stateful IPs

Is External

statefulPolicy.preservedState.externalIPs[] Configuring stateful IP addresses in MIGs
Update Policy

Max Surge Fixed

updatePolicy.maxSurge.fixed Maximum surge
Update Policy

Instance Redistribution Type

updatePolicy.instanceRedistributionType Proactive instance redistribution
Update Policy

Max Surge Percent

updatePolicy.maxSurge.percent Maximum surge
Update Policy

Max Unavailable Fixed

updatePolicy.maxUnavailable.fixed Maximum unavailable
Update Policy

Max Unavailable Percent

updatePolicy.maxUnavailable.percent Maximum unavailable
Update Policy

Min Ready Sec

updatePolicy.minReadySec Minimum wait time
Update Policy

Replacement Method

updatePolicy.replacementMethod Replacement method
Update Policy

Minimal Action

updatePolicy.minimalAction Minimal action
Update Policy

Type

updatePolicy.type Update type
Update Policy

Most Disruptive Allowed Action

updatePolicy.mostDisruptiveAllowedAction Most disruptive allowed action

Health Check Name

name Health checks overview
Health Check

Type

type Health check categories, protocols, and ports
Health Check

Initial Delay Seconds

autoHealingPolicies[].initialDelaySec Configure an autohealing policy in a MIG
Health Check

Check Interval Sec

checkIntervalSec Configure an autohealing policy in a MIG
Health Check

Healthy Threshold

healthyThreshold Configure an autohealing policy in a MIG
Health Check

Timeout Sec

timeoutSec What makes a good autohealing health check
Health Check

Unhealthy Threshold

unhealthyThreshold Configure an autohealing policy in a MIG
Health Check

Response

httpsHealthCheck.response Success criteria for HTTP, HTTPS, and HTTP/2
Health Check

Proxy Header

httpsHealthCheck.proxyHeader Headers
Health Check

Port

httpsHealthCheck.port Health check categories, protocols, and ports
Health Check

Request

tcpHealthCheck.request Success criteria for HTTP, HTTPS, and HTTP/2
Health Check

Request Path

httpsHealthCheck.requestPath Success criteria for HTTP, HTTPS, and HTTP/2
Health Check

Host

httpsHealthCheck.host Headers
Health Check

Enable Logging

logConfig.enable Health check logging information

Autoscaler Name

name

If empty, the name is derived from hostname.

Autoscaling Enabled

Create an autoscaler for the MIG.

Autoscaling groups of instances

Cooldown Period

autoscalingPolicy.coolDownPeriodSec Initialization period
Autoscaling CPU

Target

autoscalingPolicy.cpuUtilization.utilizationTarget Scaling based on CPU utilization
Autoscaling CPU

Predictive Method

autoscalingPolicy.cpuUtilization.predictiveMethod Predictive autoscaling
Autoscaling Metric

Name

name Autoscale to maintain a metric at a target value
Autoscaling Metric

Target

autoscalingPolicy.customMetricUtilizations[].utilizationTarget Autoscale to maintain a metric at a target value
Autoscaling Metric

Type

autoscalingPolicy.customMetricUtilizations[].utilizationTargetType Autoscale to maintain a metric at a target value
Scaling Schedules

Disabled

autoscalingPolicy.scalingSchedules[].disabled Scaling based on schedules
Scaling Schedules

Duration Sec

autoscalingPolicy.scalingSchedules[].durationSec Scaling schedule settings
Scaling Schedules

Min Required Replicas

autoscalingPolicy.scalingSchedules[].minRequiredReplicas Scaling schedule settings
Scaling Schedules

Name

autoscalingPolicy.scalingSchedules[] Creating a scaling schedule
Scaling Schedules

Schedule

autoscalingPolicy.scalingSchedules[].schedule Scaling schedule settings
Scaling Schedules

Time Zone

autoscalingPolicy.scalingSchedules[].timeZone Scaling schedule settings
Autoscaling Scale in Control

Fixed Replicas

autoscalingPolicy.scaleInControl.maxScaledInReplicas.fixed Configure scale-in controls
Autoscaling Scale in Control

Percent Replicas

autoscalingPolicy.scaleInControl.maxScaledInReplicas.percent Configure scale-in controls
Autoscaling Scale in Control

Time Window Sec

autoscalingPolicy.scaleInControl.timeWindowSec Configure scale-in controls
Named Ports

Name

namedPorts[].name Named ports
Named Ports

Port

namedPorts[].port Named ports

Wait for Instances

Whether to wait for all instances to be created or updated before returning. If set to true, when the operation fails, Terraform continues trying until the timeout is reached.

wait_for_instances
MIG Timeouts

Create

Timeout for Terraform instance creation.

create
MIG Timeouts

Update

Timeout for Terraform instance update.

update
MIG Timeouts

Delete

Timeout for Terraform instance deletion.

delete
Labels

Key

allInstancesConfig.properties.labels Organize resources using labels
Labels

Value

allInstancesConfig.properties.labels Organize resources using labels