Google Cloud (GCP) Classic

Pulumi Official
Package maintained by Pulumi
v6.32.0 published on Wednesday, Jul 20, 2022 by Pulumi

getInstanceGroup

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 = pulumi.output(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")
using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var all = Output.Create(Gcp.Compute.GetInstanceGroup.InvokeAsync(new Gcp.Compute.GetInstanceGroupArgs
        {
            Name = "instance-group-name",
            Zone = "us-central1-a",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

    public static void stack(Context ctx) {
        final var all = Output.of(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 dictionary

The following arguments are supported:

Name string

The name of the instance group. Either name or self_link must be provided.

Project string

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

SelfLink string

The self link of the instance group. Either name or self_link must be provided.

Zone string

The zone of the instance group. If referencing the instance group by name and zone is not provided, the provider zone is used.

Name string

The name of the instance group. Either name or self_link must be provided.

Project string

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

SelfLink string

The self link of the instance group. Either name or self_link must be provided.

Zone string

The zone of the instance group. If referencing the instance group by name and zone is not provided, the provider zone is used.

name String

The name of the instance group. Either name or self_link must be provided.

project String

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

selfLink String

The self link of the instance group. Either name or self_link must be provided.

zone String

The zone of the instance group. If referencing the instance group by name and zone is not provided, the provider zone is used.

name string

The name of the instance group. Either name or self_link must be provided.

project string

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

selfLink string

The self link of the instance group. Either name or self_link must be provided.

zone string

The zone of the instance group. If referencing the instance group by name and zone is not provided, the provider zone is used.

name str

The name of the instance group. Either name or self_link must 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 name or self_link must be provided.

zone str

The zone of the instance group. If referencing the instance group by name and zone is not provided, the provider zone is used.

name String

The name of the instance group. Either name or self_link must be provided.

project String

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

selfLink String

The self link of the instance group. Either name or self_link must be provided.

zone String

The zone of the instance group. If referencing the instance group by name and zone is 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.

NamedPorts List<GetInstanceGroupNamedPort>

List of named ports in the group.

Network string

The URL of the network the instance group is in.

Project string
SelfLink 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.

NamedPorts []GetInstanceGroupNamedPortType

List of named ports in the group.

Network string

The URL of the network the instance group is in.

Project string
SelfLink 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.

namedPorts List<GetInstanceGroupNamedPort>

List of named ports in the group.

network String

The URL of the network the instance group is in.

project String
selfLink 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.

namedPorts GetInstanceGroupNamedPort[]

List of named ports in the group.

network string

The URL of the network the instance group is in.

project string
selfLink 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[GetInstanceGroupNamedPort]

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.

namedPorts List<Property Map>

List of named ports in the group.

network String

The URL of the network the instance group is in.

project String
selfLink String

The URI of the resource.

size Number

The number of instances in the group.

zone String
name String

Supporting Types

GetInstanceGroupNamedPort

Name string

The name of the instance group. Either name or self_link must be provided.

Port int
Name string

The name of the instance group. Either name or self_link must be provided.

Port int
name String

The name of the instance group. Either name or self_link must be provided.

port Integer
name string

The name of the instance group. Either name or self_link must be provided.

port number
name str

The name of the instance group. Either name or self_link must be provided.

port int
name String

The name of the instance group. Either name or self_link must be provided.

port Number

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.