pulumi_wasm_providers_gcp_mini::compute

Module region_instance_group_manager

source
Expand description

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:

Note: Use gcp.compute.InstanceGroupManager to create a zonal instance group manager.

§Example Usage

§With Top Level Instance Template (Google Provider)

resources:
  autohealing:
    type: gcp:compute:HealthCheck
    properties:
      name: autohealing-health-check
      checkIntervalSec: 5
      timeoutSec: 5
      healthyThreshold: 2
      unhealthyThreshold: 10 # 50 seconds
      httpHealthCheck:
        requestPath: /healthz
        port: '8080'
  appserver:
    type: gcp:compute:RegionInstanceGroupManager
    properties:
      name: appserver-igm
      baseInstanceName: app
      region: us-central1
      distributionPolicyZones:
        - us-central1-a
        - us-central1-f
      versions:
        - instanceTemplate: ${appserverGoogleComputeInstanceTemplate.selfLinkUnique}
      allInstancesConfig:
        metadata:
          metadata_key: metadata_value
        labels:
          label_key: label_value
      targetPools:
        - ${appserverGoogleComputeTargetPool.id}
      targetSize: 2
      namedPorts:
        - name: custom
          port: 8888
      autoHealingPolicies:
        healthCheck: ${autohealing.id}
        initialDelaySec: 300

§With Multiple Versions

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let appserver = region_instance_group_manager::create(
        "appserver",
        RegionInstanceGroupManagerArgs::builder()
            .base_instance_name("app")
            .name("appserver-igm")
            .region("us-central1")
            .target_size(5)
            .versions(
                vec![
                    RegionInstanceGroupManagerVersion::builder()
                    .instanceTemplate("${appserverGoogleComputeInstanceTemplate.selfLinkUnique}")
                    .build_struct(), RegionInstanceGroupManagerVersion::builder()
                    .instanceTemplate("${[\"appserver-canary\"].selfLinkUnique}")
                    .targetSize(RegionInstanceGroupManagerVersionTargetSize::builder()
                    .fixed(1).build_struct()).build_struct(),
                ],
            )
            .build_struct(),
    );
}

§With Standby Policy (Google-Beta Provider)

resources:
  igm-sr:
    type: gcp:compute:RegionInstanceGroupManager
    properties:
      name: tf-sr-igm
      baseInstanceName: tf-sr-igm-instance
      region: us-central1
      targetSize: 5
      versions:
        - instanceTemplate: ${["sr-igm"].selfLink}
          name: primary
      standbyPolicy:
        initialDelaySec: 50
        mode: SCALE_OUT_POOL
      targetSuspendedSize: 1
      targetStoppedSize: 1

§Import

Instance group managers can be imported using any of these accepted formats:

  • {{name}}

When using the pulumi import command, instance group managers can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/regionInstanceGroupManager:RegionInstanceGroupManager default {{name}}

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments