GoogleComputeRegionInstanceGroupManager class final

Factory wrapper for google_compute_region_instance_group_manager.

Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances.

A managed instance group can have up to 1000 VM instances per group.

A regional Managed Instance Group (MIG) — like the zonal google_compute_instance_group_manager but distributed across multiple zones inside a single GCP region. The regional MIG drives the same VM lifecycle (create / heal / roll / preserve state) and adds three regional-only controls:

For single-zone MIGs use google_compute_instance_group_manager (curated separately, with prefix InstanceGroupManager). Aside from the zone/region distinction and the three regional-only fields above, the two resources are field-compatible.

Required identity:

  • localName: Terraform local name (the address segment after google_compute_region_instance_group_manager.).
  • name: GCP resource name (1-63 chars, lowercase RFC1035).
  • region: GCP region. The Terraform schema lists this as optional+computed (the provider falls back to the provider-level region), but it is wrapped as required here to keep cross-region composition explicit.
  • base_instance_name: 1-58 chars; each VM the MIG creates is named <base_instance_name>-<random4>.
  • At least one ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerVersion in versions; each version requires an instance_template self-link.

Cross-resource references (typical wiring):

Example (single-version regional MIG spread across two zones with proactive rebalancing):

final mig = GoogleComputeRegionInstanceGroupManager(
  localName: 'web',
  name: TfArg.literal('web-rmig'),
  region: TfArg.literal('asia-northeast1'),
  baseInstanceName: TfArg.literal('web'),
  targetSize: TfArg.literal(6),
  distributionPolicyZones: TfArg.literal([
    'asia-northeast1-a',
    'asia-northeast1-b',
  ]),
  distributionPolicyTargetShape: TfArg.literal(
    RegionInstanceGroupManagerDistributionPolicyTargetShape.even,
  ),
  versions: [
    ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerVersion(
      instanceTemplate: TfArg.literal(
        // var.instance_template_id — within-batch sibling self-link.
        'projects/p/global/instanceTemplates/web-v2',
      ),
    ),
  ],
  namedPorts: const [
    ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerNamedPort(name: 'http', port: 80),
  ],
  autoHealingPolicies: ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerAutoHealingPolicy(
    healthCheck: TfArg.literal(
      // var.health_check_id — typically a Batch 4 health check.
      'projects/p/regions/asia-northeast1/healthChecks/web-hc',
    ),
    initialDelaySec: 300,
  ),
  updatePolicy: const ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerUpdatePolicy(
    type: RegionInstanceGroupManagerUpdatePolicyType.proactive,
    instanceRedistributionType: RegionInstanceGroupManagerInstanceRedistributionType.proactive,
    minimalAction: RegionInstanceGroupManagerUpdatePolicyAction.replace,
    maxSurgeFixed: 2,
    maxUnavailableFixed: 0,
    replacementMethod:
        RegionInstanceGroupManagerUpdatePolicyReplacementMethod.substitute,
  ),
);

Sensitive fields: none. The MIG carries no secrets in its schema.

Constructors

GoogleComputeRegionInstanceGroupManager({required String localName, required TfArg<String> name, TfArg<String>? region, TfArg<String>? description, required TfArg<String> baseInstanceName, TfArg<num>? targetSize, TfArg<num>? targetStoppedSize, TfArg<num>? targetSuspendedSize, TfArg<RegionInstanceGroupManagerListManagedInstancesResults>? listManagedInstancesResults, TfArg<bool>? waitForInstances, TfArg<String>? waitForInstancesStatus, TfArg<List<String>>? distributionPolicyZones, TfArg<RegionInstanceGroupManagerDistributionPolicyTargetShape>? distributionPolicyTargetShape, TfArg<List<String>>? targetPools, required List<ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerVersion> versions, List<ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerNamedPort>? namedPorts, ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerAutoHealingPolicy? autoHealingPolicies, ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerUpdatePolicy? updatePolicy, ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerInstanceLifecyclePolicy? instanceLifecyclePolicy, ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerInstanceFlexibilityPolicy? instanceFlexibilityPolicy, ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerStandbyPolicy? standbyPolicy, List<ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerTargetSizePolicy>? targetSizePolicies, ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerResourcePolicies? resourcePolicies, ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerAllInstancesConfig? allInstancesConfig, List<ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerStatefulDisk>? statefulDisks, List<ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerStatefulIp>? statefulInternalIps, List<ComputeRegionInstanceGroupManagerRegionInstanceGroupManagerStatefulIp>? statefulExternalIps, TfArg<String>? project, LifecycleOptions? lifecycle, List<DependencyTarget>? dependsOn, String? provider, TfTimeouts? timeouts})

Properties

argMap Map<String, TfArg?>
Argument-name → TfArg map. Keys are snake_case (Terraform JSON name). Synth emits these keys directly; the factory is responsible for the camelCase → snake_case translation at construction time.
finalinherited
creationTimestamp → TfRef<String>
Reference to creation_timestamp attribute.
no setter
dependsOn List<DependencyTarget>?
Optional depends_on = [...]. Each entry is a DependencyTarget — either a wholesale resource (rendered as bare address) or an explicit TfRef (rendered via bareAddress).
finalinherited
fingerprint → TfRef<String>
Reference to fingerprint attribute.
no setter
hashCode int
The hash code for this object.
no setterinherited
id → TfRef<String>
Reference to id attribute (projects/{project}/regions/{region}/instanceGroupManagers/{name}).
no setter
instanceGroup → TfRef<String>
Reference to instance_group attribute.
no setter
instanceGroupManagerId → TfRef<int>
Reference to the server-assigned numeric instance_group_manager_id. Kept at TfRef<int> — schema type is number (derived would widen to TfRef<num>).
no setter
kind → ResourceKind
Always ResourceKind.resource. Overridden by Data.
no setterinherited
lifecycle → LifecycleOptions?
Optional lifecycle { ... } block.
finalinherited
localName String
User-supplied local name within a Stack.
finalinherited
nameRef → TfRef<String>
Reference to name attribute.
no setter
provider String?
Optional Terraform provider meta-argument: a provider name ('google-beta' on a GA type) or a name.alias pair ('google.eu').
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
Reference to self_link attribute.
no setter
sensitiveFields Set<String>
Field names that are @Sensitive per the IR-derived per-resource constant. Curated factories override with a baked-in static const Set<String> (file-private in v0.5+).
no setter
status → TfRef<List<Map<String, Object?>>>
Reference to status attribute.
no setter
supportsDeletionProtection bool
Capability flag: true when this resource's underlying Terraform schema has a deletion_protection boolean attribute that the synth-time devMode flow can flip to false. Defaults to false; the codegen emitter overrides this to true for wrappers whose schema includes the attribute.
no setterinherited
terraformType String
Terraform resource type, e.g. google_pubsub_topic.
finalinherited
tfAddress String
no setterinherited
timeouts → TfTimeouts?
Optional timeouts { ... } block: how long Terraform waits for each operation. Provider-neutral like lifecycle — synth copies the duration strings verbatim, and terraform validate decides whether this resource's schema declares the operations set here.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

tfType → const String