Build MIG configurations with autoscaling policies, update strategies, auto-healing, and distribution settings.
Last verified: May 2026
Build MIG configurations with autoscaling policies, update strategies, auto-healing, and distribution settings.
Required Fields
nameregioninstanceTemplateautoscaler.autoscalingPolicy.minNumReplicasautoscaler.autoscalingPolicy.maxNumReplicasOutput will appear here...Managed Instance Groups (MIGs) are the primary mechanism for running scalable, self-healing groups of identical Compute Engine VMs. MIGs support autoscaling based on CPU, load balancer utilization, or custom metrics, rolling updates with canary deployments, and automatic recreation of failed instances. This builder helps you configure MIG templates, autoscaling policies, update policies, health checks, and distribution shapes (even, balanced, any), outputting gcloud commands or Terraform resources.
Your team is migrating a stateless web tier from a fixed 30-VM Compute Engine fleet ($2,400/month always-on) to a regional MIG. The builder generates: regional MIG with min=5, max=30, target tracking on HTTP LB utilization at 70%, rolling update policy with maxSurge=5/maxUnavailable=0 for zero-downtime deploys, custom autohealing health check on /healthz. After deploy, fleet auto-scales between 5-15 instances during normal traffic, surges to 25 during peaks. Monthly cost drops from $2,400 to ~$900 with same SLA. Bonus: deploys are now zero-downtime via the rolling update policy.
Regional MIGs are the right default for production. The cost difference vs zonal is zero (you pay per VM, not per zone), and you get free zone-level redundancy. The only reason to use zonal MIGs is for stateful workloads that require local SSDs (which are zone-specific).
Custom metric autoscaling unlocks workload-specific scaling. Default CPU-based autoscaling lags behind real demand for queue-driven workloads. Scale based on Pub/Sub message age or queue depth instead — instances scale UP before users notice latency, scale DOWN before idle costs accrue.
Set health checks separately from load balancer health checks. The MIG's autohealing health check should be MORE strict (fail fast on unhealthy instances) while the LB's should be MORE lenient (avoid traffic blackholing during deploys). Tuning these independently is the right pattern.
The builder constructs MIG configurations: instance template (machine type, disks, networking, metadata, service account, scopes), autoscaling policy (min/max/target with metrics: CPU, LB utilization, custom metric), update policy (rolling, opportunistic, with maxSurge/maxUnavailable/minReadySec), health check, distribution shape (EVEN/BALANCED/ANY), and stateful disk preservation if needed. Output is generated as gcloud compute instance-groups managed commands and Terraform google_compute_region_instance_group_manager resources.
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.