Viewing docs for Google Cloud v9.32.1
published on Wednesday, Jul 29, 2026 by Pulumi
published on Wednesday, Jul 29, 2026 by Pulumi
Viewing docs for Google Cloud v9.32.1
published on Wednesday, Jul 29, 2026 by Pulumi
published on Wednesday, Jul 29, 2026 by Pulumi
Get a list of Instance Groups within GCE. For more information, see the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const all = gcp.compute.getInstanceGroups({
zone: "us-central1-a",
});
import pulumi
import pulumi_gcp as gcp
all = gcp.compute.get_instance_groups(zone="us-central1-a")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.GetInstanceGroups(ctx, &compute.GetInstanceGroupsArgs{
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.GetInstanceGroups.Invoke(new()
{
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.GetInstanceGroupsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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.getInstanceGroups(GetInstanceGroupsArgs.builder()
.zone("us-central1-a")
.build());
}
}
variables:
all:
fn::invoke:
function: gcp:compute:getInstanceGroups
arguments:
zone: us-central1-a
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
data "gcp_compute_getinstancegroups" "all" {
zone = "us-central1-a"
}
Using getInstanceGroups
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 getInstanceGroups(args: GetInstanceGroupsArgs, opts?: InvokeOptions): Promise<GetInstanceGroupsResult>
function getInstanceGroupsOutput(args: GetInstanceGroupsOutputArgs, opts?: InvokeOptions): Output<GetInstanceGroupsResult>def get_instance_groups(filter: Optional[str] = None,
project: Optional[str] = None,
zone: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetInstanceGroupsResult
def get_instance_groups_output(filter: pulumi.Input[Optional[str]] = None,
project: pulumi.Input[Optional[str]] = None,
zone: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInstanceGroupsResult]func GetInstanceGroups(ctx *Context, args *GetInstanceGroupsArgs, opts ...InvokeOption) (*GetInstanceGroupsResult, error)
func GetInstanceGroupsOutput(ctx *Context, args *GetInstanceGroupsOutputArgs, opts ...InvokeOption) GetInstanceGroupsResultOutput> Note: This function is named GetInstanceGroups in the Go SDK.
public static class GetInstanceGroups
{
public static Task<GetInstanceGroupsResult> InvokeAsync(GetInstanceGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetInstanceGroupsResult> Invoke(GetInstanceGroupsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetInstanceGroupsResult> getInstanceGroups(GetInstanceGroupsArgs args, InvokeOptions options)
public static Output<GetInstanceGroupsResult> getInstanceGroups(GetInstanceGroupsArgs args, InvokeOptions options)
fn::invoke:
function: gcp:compute/getInstanceGroups:getInstanceGroups
arguments:
# arguments dictionarydata "gcp_compute_get_instance_groups" "name" {
# arguments
}The following arguments are supported:
getInstanceGroups Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Groups List<GetInstance Groups Instance Group> - A list of all retrieved GCE instance groups. Structure is defined below.
- Filter string
- Project string
- The ID of the project in which the resource belongs.
- Zone string
- The zone of the instance group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Groups []GetInstance Groups Instance Group - A list of all retrieved GCE instance groups. Structure is defined below.
- Filter string
- Project string
- The ID of the project in which the resource belongs.
- Zone string
- The zone of the instance group.
- id string
- The provider-assigned unique ID for this managed resource.
- instance_
groups list(object) - A list of all retrieved GCE instance groups. Structure is defined below.
- filter string
- project string
- The ID of the project in which the resource belongs.
- zone string
- The zone of the instance group.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Groups List<GetInstance Groups Instance Group> - A list of all retrieved GCE instance groups. Structure is defined below.
- filter String
- project String
- The ID of the project in which the resource belongs.
- zone String
- The zone of the instance group.
- id string
- The provider-assigned unique ID for this managed resource.
- instance
Groups GetInstance Groups Instance Group[] - A list of all retrieved GCE instance groups. Structure is defined below.
- filter string
- project string
- The ID of the project in which the resource belongs.
- zone string
- The zone of the instance group.
- id str
- The provider-assigned unique ID for this managed resource.
- instance_
groups Sequence[GetInstance Groups Instance Group] - A list of all retrieved GCE instance groups. Structure is defined below.
- filter str
- project str
- The ID of the project in which the resource belongs.
- zone str
- The zone of the instance group.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Groups List<Property Map> - A list of all retrieved GCE instance groups. Structure is defined below.
- filter String
- project String
- The ID of the project in which the resource belongs.
- zone String
- The zone of the instance group.
Supporting Types
GetInstanceGroupsInstanceGroup
- Deletion
Policy string - Whether Terraform will be prevented from destroying the instance. Defaults to "DELETE". When a 'terraform destroy' or 'terraform apply' would delete the instance, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- Description string
- Textual description of the instance group.
- Name string
- The name of the instance group.
- Named
Ports List<GetInstance Groups Instance Group Named Port> - List of named ports in the group, as a list of objects, each with the following attributes:
- Network string
- The URL of the network the instance group is in.
- 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 URI of the resource.
- Size int
- The number of instances in the group.
- Zone string
- The zone of the instance groups. If it is not provided, the provider zone is used.
- Deletion
Policy string - Whether Terraform will be prevented from destroying the instance. Defaults to "DELETE". When a 'terraform destroy' or 'terraform apply' would delete the instance, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- Description string
- Textual description of the instance group.
- Name string
- The name of the instance group.
- Named
Ports []GetInstance Groups Instance Group Named Port - List of named ports in the group, as a list of objects, each with the following attributes:
- Network string
- The URL of the network the instance group is in.
- 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 URI of the resource.
- Size int
- The number of instances in the group.
- Zone string
- The zone of the instance groups. If it is not provided, the provider zone is used.
- deletion_
policy string - Whether Terraform will be prevented from destroying the instance. Defaults to "DELETE". When a 'terraform destroy' or 'terraform apply' would delete the instance, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description string
- Textual description of the instance group.
- name string
- The name of the instance group.
- named_
ports list(object) - List of named ports in the group, as a list of objects, each with the following attributes:
- network string
- The URL of the network the instance group is in.
- 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 URI of the resource.
- size number
- The number of instances in the group.
- zone string
- The zone of the instance groups. If it is not provided, the provider zone is used.
- deletion
Policy String - Whether Terraform will be prevented from destroying the instance. Defaults to "DELETE". When a 'terraform destroy' or 'terraform apply' would delete the instance, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description String
- Textual description of the instance group.
- name String
- The name of the instance group.
- named
Ports List<GetInstance Groups Instance Group Named Port> - List of named ports in the group, as a list of objects, each with the following attributes:
- network String
- The URL of the network the instance group is in.
- 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 URI of the resource.
- size Integer
- The number of instances in the group.
- zone String
- The zone of the instance groups. If it is not provided, the provider zone is used.
- deletion
Policy string - Whether Terraform will be prevented from destroying the instance. Defaults to "DELETE". When a 'terraform destroy' or 'terraform apply' would delete the instance, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description string
- Textual description of the instance group.
- name string
- The name of the instance group.
- named
Ports GetInstance Groups Instance Group Named Port[] - List of named ports in the group, as a list of objects, each with the following attributes:
- network string
- The URL of the network the instance group is in.
- 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 URI of the resource.
- size number
- The number of instances in the group.
- zone string
- The zone of the instance groups. If it is not provided, the provider zone is used.
- deletion_
policy str - Whether Terraform will be prevented from destroying the instance. Defaults to "DELETE". When a 'terraform destroy' or 'terraform apply' would delete the instance, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description str
- Textual description of the instance group.
- name str
- The name of the instance group.
- named_
ports Sequence[GetInstance Groups Instance Group Named Port] - List of named ports in the group, as a list of objects, each with the following attributes:
- network str
- The URL of the network the instance group is in.
- 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 URI of the resource.
- size int
- The number of instances in the group.
- zone str
- The zone of the instance groups. If it is not provided, the provider zone is used.
- deletion
Policy String - Whether Terraform will be prevented from destroying the instance. Defaults to "DELETE". When a 'terraform destroy' or 'terraform apply' would delete the instance, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description String
- Textual description of the instance group.
- name String
- The name of the instance group.
- named
Ports List<Property Map> - List of named ports in the group, as a list of objects, each with the following attributes:
- network String
- The URL of the network the instance group is in.
- 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 URI of the resource.
- size Number
- The number of instances in the group.
- zone String
- The zone of the instance groups. If it is not provided, the provider zone is used.
GetInstanceGroupsInstanceGroupNamedPort
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.
Viewing docs for Google Cloud v9.32.1
published on Wednesday, Jul 29, 2026 by Pulumi
published on Wednesday, Jul 29, 2026 by Pulumi