Google Compute Engine Region Instance Group Manager

This page shows how to write Terraform for Compute Engine Region Instance Group Manager and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (google_compute_region_instance_group_manager)

The Google Compute Engine Regional Instance Group Manager API creates and manages pools of homogeneous Compute Engine virtual machine instances from a common instance template. To get more information about regionInstanceGroupManagers, see:

Parameters

  • base_instance_name required - string
    • The base instance name to use for instances in this group. The value must be a valid RFC1035 name. Supported characters are lowercase letters, numbers, and hyphens (-). Instances are named by appending a hyphen and a random four-character string to the base instance name.

  • description optional - string
    • An optional textual description of the instance group manager.

  • distribution_policy_target_shape optionalcomputed - string
    • The shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType).

  • distribution_policy_zones optionalcomputed - set / string
    • The distribution policy for this managed instance group. You can specify one or more values.

  • fingerprint requiredcomputed - string
    • The fingerprint of the instance group manager.

  • id optionalcomputed - string
  • instance_group requiredcomputed - string
    • The full URL of the instance group created by the manager.

  • name required - string
    • The name of the instance group manager. Must be 1-63 characters long and comply with RFC1035. Supported characters include lowercase letters, numbers, and hyphens.

  • project optionalcomputed - string
    • The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • region optionalcomputed - string
    • The region where the managed instance group resides.

  • self_link requiredcomputed - string
    • The URL of the created resource.

  • target_pools optional - set / string
    • The full URL of all target pools to which new instances in the group are added. Updating the target pools attribute does not affect existing instances.

  • target_size optionalcomputed - number
    • 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. Defaults to 0.

  • wait_for_instances optional - bool
    • 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.

Example Usage (from GitHub)

github-iconpankajakhade/assignments
resource "google_compute_region_instance_group_manager" "app-igm" {
  provider = google-beta
  region   = var.region
  name     = "backend-igm"
  version {
    instance_template = google_compute_instance_template.app-template.id
github-iconawiradarma/gcp
resource "google_compute_region_instance_group_manager" "ext-http-lb-us" {
  name = "webserver-us"

  base_instance_name         = "webserver-us"
  region                     = "us-central1"
  distribution_policy_zones  = ["us-central1-a", "us-central1-f"]
github-iconKawiNeal/http-loadbalancer
resource "google_compute_region_instance_group_manager" "appserver" {

  # Count for list of group managers
  count = length(var.group_mgr_names)

  name               = element(var.group_mgr_names, count.index)

Frequently asked questions

What is Google Compute Engine Region Instance Group Manager?

Google Compute Engine Region Instance Group Manager is a resource for Compute Engine of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Compute Engine Region Instance Group Manager?

For Terraform, the pankajakhade/assignments, awiradarma/gcp and KawiNeal/http-loadbalancer source code examples are useful. See the Terraform Example section for further details.