1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getRegionInstanceGroup
Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi

gcp.compute.getRegionInstanceGroup

Explore with Pulumi AI

Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi

Get a Compute Region Instance Group within GCE. For more information, see the official documentation and API.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const group = gcp.compute.getRegionInstanceGroup({
    name: "instance-group-name",
});
Copy
import pulumi
import pulumi_gcp as gcp

group = gcp.compute.get_region_instance_group(name="instance-group-name")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.GetRegionInstanceGroup(ctx, &compute.GetRegionInstanceGroupArgs{
			Name: pulumi.StringRef("instance-group-name"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var @group = Gcp.Compute.GetRegionInstanceGroup.Invoke(new()
    {
        Name = "instance-group-name",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetRegionInstanceGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var group = ComputeFunctions.getRegionInstanceGroup(GetRegionInstanceGroupArgs.builder()
            .name("instance-group-name")
            .build());

    }
}
Copy
variables:
  group:
    fn::invoke:
      function: gcp:compute:getRegionInstanceGroup
      arguments:
        name: instance-group-name
Copy

The most common use of this datasource will be to fetch information about the instances inside regional managed instance groups, for instance:

Using getRegionInstanceGroup

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getRegionInstanceGroup(args: GetRegionInstanceGroupArgs, opts?: InvokeOptions): Promise<GetRegionInstanceGroupResult>
function getRegionInstanceGroupOutput(args: GetRegionInstanceGroupOutputArgs, opts?: InvokeOptions): Output<GetRegionInstanceGroupResult>
Copy
def get_region_instance_group(name: Optional[str] = None,
                              project: Optional[str] = None,
                              region: Optional[str] = None,
                              self_link: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetRegionInstanceGroupResult
def get_region_instance_group_output(name: Optional[pulumi.Input[str]] = None,
                              project: Optional[pulumi.Input[str]] = None,
                              region: Optional[pulumi.Input[str]] = None,
                              self_link: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetRegionInstanceGroupResult]
Copy
func GetRegionInstanceGroup(ctx *Context, args *GetRegionInstanceGroupArgs, opts ...InvokeOption) (*GetRegionInstanceGroupResult, error)
func GetRegionInstanceGroupOutput(ctx *Context, args *GetRegionInstanceGroupOutputArgs, opts ...InvokeOption) GetRegionInstanceGroupResultOutput
Copy

> Note: This function is named GetRegionInstanceGroup in the Go SDK.

public static class GetRegionInstanceGroup 
{
    public static Task<GetRegionInstanceGroupResult> InvokeAsync(GetRegionInstanceGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetRegionInstanceGroupResult> Invoke(GetRegionInstanceGroupInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRegionInstanceGroupResult> getRegionInstanceGroup(GetRegionInstanceGroupArgs args, InvokeOptions options)
public static Output<GetRegionInstanceGroupResult> getRegionInstanceGroup(GetRegionInstanceGroupArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:compute/getRegionInstanceGroup:getRegionInstanceGroup
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name Changes to this property will trigger replacement. string
The name of the instance group. One of name or self_link must be provided.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used.
Region Changes to this property will trigger replacement. string
The region in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor region are provided, the provider region is used.
SelfLink Changes to this property will trigger replacement. string
The link to the instance group. One of name or self_link must be provided.


Name Changes to this property will trigger replacement. string
The name of the instance group. One of name or self_link must be provided.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used.
Region Changes to this property will trigger replacement. string
The region in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor region are provided, the provider region is used.
SelfLink Changes to this property will trigger replacement. string
The link to the instance group. One of name or self_link must be provided.


name Changes to this property will trigger replacement. String
The name of the instance group. One of name or self_link must be provided.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used.
region Changes to this property will trigger replacement. String
The region in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor region are provided, the provider region is used.
selfLink Changes to this property will trigger replacement. String
The link to the instance group. One of name or self_link must be provided.


name Changes to this property will trigger replacement. string
The name of the instance group. One of name or self_link must be provided.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used.
region Changes to this property will trigger replacement. string
The region in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor region are provided, the provider region is used.
selfLink Changes to this property will trigger replacement. string
The link to the instance group. One of name or self_link must be provided.


name Changes to this property will trigger replacement. str
The name of the instance group. One of name or self_link must be provided.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used.
region Changes to this property will trigger replacement. str
The region in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor region are provided, the provider region is used.
self_link Changes to this property will trigger replacement. str
The link to the instance group. One of name or self_link must be provided.


name Changes to this property will trigger replacement. String
The name of the instance group. One of name or self_link must be provided.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used.
region Changes to this property will trigger replacement. String
The region in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor region are provided, the provider region is used.
selfLink Changes to this property will trigger replacement. String
The link to the instance group. One of name or self_link must be provided.


getRegionInstanceGroup Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Instances List<GetRegionInstanceGroupInstance>
List of instances in the group, as a list of resources, each containing:
Name string
String port name
Project string
Region string
SelfLink string
Size int
The number of instances in the group.
Id string
The provider-assigned unique ID for this managed resource.
Instances []GetRegionInstanceGroupInstance
List of instances in the group, as a list of resources, each containing:
Name string
String port name
Project string
Region string
SelfLink string
Size int
The number of instances in the group.
id String
The provider-assigned unique ID for this managed resource.
instances List<GetRegionInstanceGroupInstance>
List of instances in the group, as a list of resources, each containing:
name String
String port name
project String
region String
selfLink String
size Integer
The number of instances in the group.
id string
The provider-assigned unique ID for this managed resource.
instances GetRegionInstanceGroupInstance[]
List of instances in the group, as a list of resources, each containing:
name string
String port name
project string
region string
selfLink string
size number
The number of instances in the group.
id str
The provider-assigned unique ID for this managed resource.
instances Sequence[GetRegionInstanceGroupInstance]
List of instances in the group, as a list of resources, each containing:
name str
String port name
project str
region str
self_link str
size int
The number of instances in the group.
id String
The provider-assigned unique ID for this managed resource.
instances List<Property Map>
List of instances in the group, as a list of resources, each containing:
name String
String port name
project String
region String
selfLink String
size Number
The number of instances in the group.

Supporting Types

GetRegionInstanceGroupInstance

Instance This property is required. string
URL to the instance.
NamedPorts This property is required. List<GetRegionInstanceGroupInstanceNamedPort>
List of named ports in the group, as a list of resources, each containing:
Status This property is required. string
String description of current state of the instance.
Instance This property is required. string
URL to the instance.
NamedPorts This property is required. []GetRegionInstanceGroupInstanceNamedPort
List of named ports in the group, as a list of resources, each containing:
Status This property is required. string
String description of current state of the instance.
instance This property is required. String
URL to the instance.
namedPorts This property is required. List<GetRegionInstanceGroupInstanceNamedPort>
List of named ports in the group, as a list of resources, each containing:
status This property is required. String
String description of current state of the instance.
instance This property is required. string
URL to the instance.
namedPorts This property is required. GetRegionInstanceGroupInstanceNamedPort[]
List of named ports in the group, as a list of resources, each containing:
status This property is required. string
String description of current state of the instance.
instance This property is required. str
URL to the instance.
named_ports This property is required. Sequence[GetRegionInstanceGroupInstanceNamedPort]
List of named ports in the group, as a list of resources, each containing:
status This property is required. str
String description of current state of the instance.
instance This property is required. String
URL to the instance.
namedPorts This property is required. List<Property Map>
List of named ports in the group, as a list of resources, each containing:
status This property is required. String
String description of current state of the instance.

GetRegionInstanceGroupInstanceNamedPort

Name This property is required. string
The name of the instance group. One of name or self_link must be provided.
Port This property is required. int
Integer port number
Name This property is required. string
The name of the instance group. One of name or self_link must be provided.
Port This property is required. int
Integer port number
name This property is required. String
The name of the instance group. One of name or self_link must be provided.
port This property is required. Integer
Integer port number
name This property is required. string
The name of the instance group. One of name or self_link must be provided.
port This property is required. number
Integer port number
name This property is required. str
The name of the instance group. One of name or self_link must be provided.
port This property is required. int
Integer port number
name This property is required. String
The name of the instance group. One of name or self_link must be provided.
port This property is required. Number
Integer port number

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi