Google Cloud v8.14.0 published on Wednesday, Jan 15, 2025 by Pulumi
gcp.compute.getInstanceGroup
Explore with Pulumi AI
Get a Compute 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 all = gcp.compute.getInstanceGroup({
    name: "instance-group-name",
    zone: "us-central1-a",
});
import pulumi
import pulumi_gcp as gcp
all = gcp.compute.get_instance_group(name="instance-group-name",
    zone="us-central1-a")
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.LookupInstanceGroup(ctx, &compute.LookupInstanceGroupArgs{
			Name: pulumi.StringRef("instance-group-name"),
			Zone: pulumi.StringRef("us-central1-a"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() => 
{
    var all = Gcp.Compute.GetInstanceGroup.Invoke(new()
    {
        Name = "instance-group-name",
        Zone = "us-central1-a",
    });
});
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.GetInstanceGroupArgs;
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 all = ComputeFunctions.getInstanceGroup(GetInstanceGroupArgs.builder()
            .name("instance-group-name")
            .zone("us-central1-a")
            .build());
    }
}
variables:
  all:
    fn::invoke:
      function: gcp:compute:getInstanceGroup
      arguments:
        name: instance-group-name
        zone: us-central1-a
Using getInstanceGroup
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 getInstanceGroup(args: GetInstanceGroupArgs, opts?: InvokeOptions): Promise<GetInstanceGroupResult>
function getInstanceGroupOutput(args: GetInstanceGroupOutputArgs, opts?: InvokeOptions): Output<GetInstanceGroupResult>def get_instance_group(name: Optional[str] = None,
                       project: Optional[str] = None,
                       self_link: Optional[str] = None,
                       zone: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetInstanceGroupResult
def get_instance_group_output(name: Optional[pulumi.Input[str]] = None,
                       project: Optional[pulumi.Input[str]] = None,
                       self_link: Optional[pulumi.Input[str]] = None,
                       zone: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetInstanceGroupResult]func LookupInstanceGroup(ctx *Context, args *LookupInstanceGroupArgs, opts ...InvokeOption) (*LookupInstanceGroupResult, error)
func LookupInstanceGroupOutput(ctx *Context, args *LookupInstanceGroupOutputArgs, opts ...InvokeOption) LookupInstanceGroupResultOutput> Note: This function is named LookupInstanceGroup in the Go SDK.
public static class GetInstanceGroup 
{
    public static Task<GetInstanceGroupResult> InvokeAsync(GetInstanceGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceGroupResult> Invoke(GetInstanceGroupInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetInstanceGroupResult> getInstanceGroup(GetInstanceGroupArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gcp:compute/getInstanceGroup:getInstanceGroup
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
 - The name of the instance group. Either 
nameorself_linkmust be provided. - Project string
 - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 - Self
Link string - The self link of the instance group. Either 
nameorself_linkmust be provided. - Zone string
 - The zone of the instance group. If referencing the instance group by name
and 
zoneis not provided, the provider zone is used. 
- Name string
 - The name of the instance group. Either 
nameorself_linkmust be provided. - Project string
 - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 - Self
Link string - The self link of the instance group. Either 
nameorself_linkmust be provided. - Zone string
 - The zone of the instance group. If referencing the instance group by name
and 
zoneis not provided, the provider zone is used. 
- name String
 - The name of the instance group. Either 
nameorself_linkmust be provided. - project String
 - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 - self
Link String - The self link of the instance group. Either 
nameorself_linkmust be provided. - zone String
 - The zone of the instance group. If referencing the instance group by name
and 
zoneis not provided, the provider zone is used. 
- name string
 - The name of the instance group. Either 
nameorself_linkmust be provided. - project string
 - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 - self
Link string - The self link of the instance group. Either 
nameorself_linkmust be provided. - zone string
 - The zone of the instance group. If referencing the instance group by name
and 
zoneis not provided, the provider zone is used. 
- name str
 - The name of the instance group. Either 
nameorself_linkmust be provided. - project str
 - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 - self_
link str - The self link of the instance group. Either 
nameorself_linkmust be provided. - zone str
 - The zone of the instance group. If referencing the instance group by name
and 
zoneis not provided, the provider zone is used. 
- name String
 - The name of the instance group. Either 
nameorself_linkmust be provided. - project String
 - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 - self
Link String - The self link of the instance group. Either 
nameorself_linkmust be provided. - zone String
 - The zone of the instance group. If referencing the instance group by name
and 
zoneis not provided, the provider zone is used. 
getInstanceGroup Result
The following output properties are available:
- Description string
 - Textual description of the instance group.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Instances List<string>
 - List of instances in the group.
 - Named
Ports List<GetInstance Group Named Port>  - List of named ports in the group.
 - Network string
 - The URL of the network the instance group is in.
 - Project string
 - Self
Link string - The URI of the resource.
 - Size int
 - The number of instances in the group.
 - Zone string
 - Name string
 
- Description string
 - Textual description of the instance group.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Instances []string
 - List of instances in the group.
 - Named
Ports []GetInstance Group Named Port Type  - List of named ports in the group.
 - Network string
 - The URL of the network the instance group is in.
 - Project string
 - Self
Link string - The URI of the resource.
 - Size int
 - The number of instances in the group.
 - Zone string
 - Name string
 
- description String
 - Textual description of the instance group.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - instances List<String>
 - List of instances in the group.
 - named
Ports List<GetInstance Group Named Port>  - List of named ports in the group.
 - network String
 - The URL of the network the instance group is in.
 - project String
 - self
Link String - The URI of the resource.
 - size Integer
 - The number of instances in the group.
 - zone String
 - name String
 
- description string
 - Textual description of the instance group.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - instances string[]
 - List of instances in the group.
 - named
Ports GetInstance Group Named Port[]  - List of named ports in the group.
 - network string
 - The URL of the network the instance group is in.
 - project string
 - self
Link string - The URI of the resource.
 - size number
 - The number of instances in the group.
 - zone string
 - name string
 
- description str
 - Textual description of the instance group.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - instances Sequence[str]
 - List of instances in the group.
 - named_
ports Sequence[GetInstance Group Named Port]  - List of named ports in the group.
 - network str
 - The URL of the network the instance group is in.
 - project str
 - self_
link str - The URI of the resource.
 - size int
 - The number of instances in the group.
 - zone str
 - name str
 
- description String
 - Textual description of the instance group.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - instances List<String>
 - List of instances in the group.
 - named
Ports List<Property Map> - List of named ports in the group.
 - network String
 - The URL of the network the instance group is in.
 - project String
 - self
Link String - The URI of the resource.
 - size Number
 - The number of instances in the group.
 - zone String
 - name String
 
Supporting Types
GetInstanceGroupNamedPort    
Package Details
- Repository
 - Google Cloud (GCP) Classic pulumi/pulumi-gcp
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
google-betaTerraform Provider.