1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getReservationSubBlock
Google Cloud v9.6.0 published on Wednesday, Nov 26, 2025 by Pulumi
gcp logo
Google Cloud v9.6.0 published on Wednesday, Nov 26, 2025 by Pulumi

    Get information about a Google Compute Engine Reservation Sub-Block. Reservation sub-blocks are automatically created by Google Cloud within reservation blocks and represent a finer-grained physical grouping of resources.

    For more information see the official documentation and the API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const subBlock = gcp.compute.getReservationSubBlock({
        name: "my-reservation-sub-block",
        reservationBlock: "my-reservation-block",
        reservation: "my-reservation",
        zone: "us-central1-a",
    });
    export const subBlockStatus = subBlock.then(subBlock => subBlock.status);
    export const subBlockHealth = subBlock.then(subBlock => subBlock.healthInfos);
    
    import pulumi
    import pulumi_gcp as gcp
    
    sub_block = gcp.compute.get_reservation_sub_block(name="my-reservation-sub-block",
        reservation_block="my-reservation-block",
        reservation="my-reservation",
        zone="us-central1-a")
    pulumi.export("subBlockStatus", sub_block.status)
    pulumi.export("subBlockHealth", sub_block.health_infos)
    
    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 {
    		subBlock, err := compute.GetReservationSubBlock(ctx, &compute.GetReservationSubBlockArgs{
    			Name:             "my-reservation-sub-block",
    			ReservationBlock: "my-reservation-block",
    			Reservation:      "my-reservation",
    			Zone:             pulumi.StringRef("us-central1-a"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("subBlockStatus", subBlock.Status)
    		ctx.Export("subBlockHealth", subBlock.HealthInfos)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var subBlock = Gcp.Compute.GetReservationSubBlock.Invoke(new()
        {
            Name = "my-reservation-sub-block",
            ReservationBlock = "my-reservation-block",
            Reservation = "my-reservation",
            Zone = "us-central1-a",
        });
    
        return new Dictionary<string, object?>
        {
            ["subBlockStatus"] = subBlock.Apply(getReservationSubBlockResult => getReservationSubBlockResult.Status),
            ["subBlockHealth"] = subBlock.Apply(getReservationSubBlockResult => getReservationSubBlockResult.HealthInfos),
        };
    });
    
    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.GetReservationSubBlockArgs;
    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 subBlock = ComputeFunctions.getReservationSubBlock(GetReservationSubBlockArgs.builder()
                .name("my-reservation-sub-block")
                .reservationBlock("my-reservation-block")
                .reservation("my-reservation")
                .zone("us-central1-a")
                .build());
    
            ctx.export("subBlockStatus", subBlock.status());
            ctx.export("subBlockHealth", subBlock.healthInfos());
        }
    }
    
    variables:
      subBlock:
        fn::invoke:
          function: gcp:compute:getReservationSubBlock
          arguments:
            name: my-reservation-sub-block
            reservationBlock: my-reservation-block
            reservation: my-reservation
            zone: us-central1-a
    outputs:
      subBlockStatus: ${subBlock.status}
      subBlockHealth: ${subBlock.healthInfos}
    

    Using getReservationSubBlock

    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 getReservationSubBlock(args: GetReservationSubBlockArgs, opts?: InvokeOptions): Promise<GetReservationSubBlockResult>
    function getReservationSubBlockOutput(args: GetReservationSubBlockOutputArgs, opts?: InvokeOptions): Output<GetReservationSubBlockResult>
    def get_reservation_sub_block(name: Optional[str] = None,
                                  project: Optional[str] = None,
                                  reservation: Optional[str] = None,
                                  reservation_block: Optional[str] = None,
                                  zone: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetReservationSubBlockResult
    def get_reservation_sub_block_output(name: Optional[pulumi.Input[str]] = None,
                                  project: Optional[pulumi.Input[str]] = None,
                                  reservation: Optional[pulumi.Input[str]] = None,
                                  reservation_block: Optional[pulumi.Input[str]] = None,
                                  zone: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetReservationSubBlockResult]
    func GetReservationSubBlock(ctx *Context, args *GetReservationSubBlockArgs, opts ...InvokeOption) (*GetReservationSubBlockResult, error)
    func GetReservationSubBlockOutput(ctx *Context, args *GetReservationSubBlockOutputArgs, opts ...InvokeOption) GetReservationSubBlockResultOutput

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

    public static class GetReservationSubBlock 
    {
        public static Task<GetReservationSubBlockResult> InvokeAsync(GetReservationSubBlockArgs args, InvokeOptions? opts = null)
        public static Output<GetReservationSubBlockResult> Invoke(GetReservationSubBlockInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetReservationSubBlockResult> getReservationSubBlock(GetReservationSubBlockArgs args, InvokeOptions options)
    public static Output<GetReservationSubBlockResult> getReservationSubBlock(GetReservationSubBlockArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:compute/getReservationSubBlock:getReservationSubBlock
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the reservation sub-block.
    Reservation string
    The name of the parent reservation.
    ReservationBlock string
    The name of the parent reservation block.
    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Zone string
    The zone where the reservation sub-block resides.


    Name string
    The name of the reservation sub-block.
    Reservation string
    The name of the parent reservation.
    ReservationBlock string
    The name of the parent reservation block.
    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Zone string
    The zone where the reservation sub-block resides.


    name String
    The name of the reservation sub-block.
    reservation String
    The name of the parent reservation.
    reservationBlock String
    The name of the parent reservation block.
    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    zone String
    The zone where the reservation sub-block resides.


    name string
    The name of the reservation sub-block.
    reservation string
    The name of the parent reservation.
    reservationBlock string
    The name of the parent reservation block.
    project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    zone string
    The zone where the reservation sub-block resides.


    name str
    The name of the reservation sub-block.
    reservation str
    The name of the parent reservation.
    reservation_block str
    The name of the parent reservation block.
    project str
    The project in which the resource belongs. If it is not provided, the provider project is used.
    zone str
    The zone where the reservation sub-block resides.


    name String
    The name of the reservation sub-block.
    reservation String
    The name of the parent reservation.
    reservationBlock String
    The name of the parent reservation block.
    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    zone String
    The zone where the reservation sub-block resides.


    getReservationSubBlock Result

    The following output properties are available:

    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    HealthInfos List<GetReservationSubBlockHealthInfo>
    Health information for the reservation sub-block. Structure is documented below.
    Id string
    The provider-assigned unique ID for this managed resource.
    InUseCount int
    The number of instances that are currently in use on this reservation sub-block.
    Kind string
    Type of the resource. Always compute#reservationSubBlock for reservation sub-blocks.
    Name string
    PhysicalTopologies List<GetReservationSubBlockPhysicalTopology>
    The physical topology of the reservation sub-block. Structure is documented below.
    Project string
    Reservation string
    ReservationBlock string
    ReservationSubBlockMaintenances List<GetReservationSubBlockReservationSubBlockMaintenance>
    Maintenance information for this reservation sub-block. Structure is documented below.
    ResourceId string
    The unique identifier for the resource.
    SelfLink string
    Server-defined fully-qualified URL for this resource.
    SelfLinkWithId string
    Server-defined URL for this resource with the resource id.
    Status string
    Status of the reservation sub-block.
    SubBlockCount int
    The number of hosts that are allocated in this reservation sub-block.
    Zone string
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    HealthInfos []GetReservationSubBlockHealthInfo
    Health information for the reservation sub-block. Structure is documented below.
    Id string
    The provider-assigned unique ID for this managed resource.
    InUseCount int
    The number of instances that are currently in use on this reservation sub-block.
    Kind string
    Type of the resource. Always compute#reservationSubBlock for reservation sub-blocks.
    Name string
    PhysicalTopologies []GetReservationSubBlockPhysicalTopology
    The physical topology of the reservation sub-block. Structure is documented below.
    Project string
    Reservation string
    ReservationBlock string
    ReservationSubBlockMaintenances []GetReservationSubBlockReservationSubBlockMaintenance
    Maintenance information for this reservation sub-block. Structure is documented below.
    ResourceId string
    The unique identifier for the resource.
    SelfLink string
    Server-defined fully-qualified URL for this resource.
    SelfLinkWithId string
    Server-defined URL for this resource with the resource id.
    Status string
    Status of the reservation sub-block.
    SubBlockCount int
    The number of hosts that are allocated in this reservation sub-block.
    Zone string
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    healthInfos List<GetReservationSubBlockHealthInfo>
    Health information for the reservation sub-block. Structure is documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    inUseCount Integer
    The number of instances that are currently in use on this reservation sub-block.
    kind String
    Type of the resource. Always compute#reservationSubBlock for reservation sub-blocks.
    name String
    physicalTopologies List<GetReservationSubBlockPhysicalTopology>
    The physical topology of the reservation sub-block. Structure is documented below.
    project String
    reservation String
    reservationBlock String
    reservationSubBlockMaintenances List<GetReservationSubBlockReservationSubBlockMaintenance>
    Maintenance information for this reservation sub-block. Structure is documented below.
    resourceId String
    The unique identifier for the resource.
    selfLink String
    Server-defined fully-qualified URL for this resource.
    selfLinkWithId String
    Server-defined URL for this resource with the resource id.
    status String
    Status of the reservation sub-block.
    subBlockCount Integer
    The number of hosts that are allocated in this reservation sub-block.
    zone String
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    healthInfos GetReservationSubBlockHealthInfo[]
    Health information for the reservation sub-block. Structure is documented below.
    id string
    The provider-assigned unique ID for this managed resource.
    inUseCount number
    The number of instances that are currently in use on this reservation sub-block.
    kind string
    Type of the resource. Always compute#reservationSubBlock for reservation sub-blocks.
    name string
    physicalTopologies GetReservationSubBlockPhysicalTopology[]
    The physical topology of the reservation sub-block. Structure is documented below.
    project string
    reservation string
    reservationBlock string
    reservationSubBlockMaintenances GetReservationSubBlockReservationSubBlockMaintenance[]
    Maintenance information for this reservation sub-block. Structure is documented below.
    resourceId string
    The unique identifier for the resource.
    selfLink string
    Server-defined fully-qualified URL for this resource.
    selfLinkWithId string
    Server-defined URL for this resource with the resource id.
    status string
    Status of the reservation sub-block.
    subBlockCount number
    The number of hosts that are allocated in this reservation sub-block.
    zone string
    creation_timestamp str
    Creation timestamp in RFC3339 text format.
    health_infos Sequence[GetReservationSubBlockHealthInfo]
    Health information for the reservation sub-block. Structure is documented below.
    id str
    The provider-assigned unique ID for this managed resource.
    in_use_count int
    The number of instances that are currently in use on this reservation sub-block.
    kind str
    Type of the resource. Always compute#reservationSubBlock for reservation sub-blocks.
    name str
    physical_topologies Sequence[GetReservationSubBlockPhysicalTopology]
    The physical topology of the reservation sub-block. Structure is documented below.
    project str
    reservation str
    reservation_block str
    reservation_sub_block_maintenances Sequence[GetReservationSubBlockReservationSubBlockMaintenance]
    Maintenance information for this reservation sub-block. Structure is documented below.
    resource_id str
    The unique identifier for the resource.
    self_link str
    Server-defined fully-qualified URL for this resource.
    self_link_with_id str
    Server-defined URL for this resource with the resource id.
    status str
    Status of the reservation sub-block.
    sub_block_count int
    The number of hosts that are allocated in this reservation sub-block.
    zone str
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    healthInfos List<Property Map>
    Health information for the reservation sub-block. Structure is documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    inUseCount Number
    The number of instances that are currently in use on this reservation sub-block.
    kind String
    Type of the resource. Always compute#reservationSubBlock for reservation sub-blocks.
    name String
    physicalTopologies List<Property Map>
    The physical topology of the reservation sub-block. Structure is documented below.
    project String
    reservation String
    reservationBlock String
    reservationSubBlockMaintenances List<Property Map>
    Maintenance information for this reservation sub-block. Structure is documented below.
    resourceId String
    The unique identifier for the resource.
    selfLink String
    Server-defined fully-qualified URL for this resource.
    selfLinkWithId String
    Server-defined URL for this resource with the resource id.
    status String
    Status of the reservation sub-block.
    subBlockCount Number
    The number of hosts that are allocated in this reservation sub-block.
    zone String

    Supporting Types

    GetReservationSubBlockHealthInfo

    DegradedHostCount int
    The number of degraded hosts in the reservation sub-block.
    DegradedInfraCount int
    The number of degraded infrastructure (e.g. NVLink domain) in the reservation sub-block.
    HealthStatus string
    The health status of the reservation sub-block.
    HealthyHostCount int
    The number of healthy hosts in the reservation sub-block.
    HealthyInfraCount int
    The number of healthy infrastructure (e.g. NVLink domain) in the reservation sub-block.
    DegradedHostCount int
    The number of degraded hosts in the reservation sub-block.
    DegradedInfraCount int
    The number of degraded infrastructure (e.g. NVLink domain) in the reservation sub-block.
    HealthStatus string
    The health status of the reservation sub-block.
    HealthyHostCount int
    The number of healthy hosts in the reservation sub-block.
    HealthyInfraCount int
    The number of healthy infrastructure (e.g. NVLink domain) in the reservation sub-block.
    degradedHostCount Integer
    The number of degraded hosts in the reservation sub-block.
    degradedInfraCount Integer
    The number of degraded infrastructure (e.g. NVLink domain) in the reservation sub-block.
    healthStatus String
    The health status of the reservation sub-block.
    healthyHostCount Integer
    The number of healthy hosts in the reservation sub-block.
    healthyInfraCount Integer
    The number of healthy infrastructure (e.g. NVLink domain) in the reservation sub-block.
    degradedHostCount number
    The number of degraded hosts in the reservation sub-block.
    degradedInfraCount number
    The number of degraded infrastructure (e.g. NVLink domain) in the reservation sub-block.
    healthStatus string
    The health status of the reservation sub-block.
    healthyHostCount number
    The number of healthy hosts in the reservation sub-block.
    healthyInfraCount number
    The number of healthy infrastructure (e.g. NVLink domain) in the reservation sub-block.
    degraded_host_count int
    The number of degraded hosts in the reservation sub-block.
    degraded_infra_count int
    The number of degraded infrastructure (e.g. NVLink domain) in the reservation sub-block.
    health_status str
    The health status of the reservation sub-block.
    healthy_host_count int
    The number of healthy hosts in the reservation sub-block.
    healthy_infra_count int
    The number of healthy infrastructure (e.g. NVLink domain) in the reservation sub-block.
    degradedHostCount Number
    The number of degraded hosts in the reservation sub-block.
    degradedInfraCount Number
    The number of degraded infrastructure (e.g. NVLink domain) in the reservation sub-block.
    healthStatus String
    The health status of the reservation sub-block.
    healthyHostCount Number
    The number of healthy hosts in the reservation sub-block.
    healthyInfraCount Number
    The number of healthy infrastructure (e.g. NVLink domain) in the reservation sub-block.

    GetReservationSubBlockPhysicalTopology

    Block string
    The hash of the capacity block within the cluster.
    Cluster string
    The cluster name of the reservation sub-block.
    SubBlock string
    The hash of the capacity sub-block within the capacity block.
    Block string
    The hash of the capacity block within the cluster.
    Cluster string
    The cluster name of the reservation sub-block.
    SubBlock string
    The hash of the capacity sub-block within the capacity block.
    block String
    The hash of the capacity block within the cluster.
    cluster String
    The cluster name of the reservation sub-block.
    subBlock String
    The hash of the capacity sub-block within the capacity block.
    block string
    The hash of the capacity block within the cluster.
    cluster string
    The cluster name of the reservation sub-block.
    subBlock string
    The hash of the capacity sub-block within the capacity block.
    block str
    The hash of the capacity block within the cluster.
    cluster str
    The cluster name of the reservation sub-block.
    sub_block str
    The hash of the capacity sub-block within the capacity block.
    block String
    The hash of the capacity block within the cluster.
    cluster String
    The cluster name of the reservation sub-block.
    subBlock String
    The hash of the capacity sub-block within the capacity block.

    GetReservationSubBlockReservationSubBlockMaintenance

    InstanceMaintenanceOngoingCount int
    Number of instances that have ongoing maintenance.
    InstanceMaintenancePendingCount int
    Number of instances that have pending maintenance.
    MaintenanceOngoingCount int
    Number of hosts in the sub-block that have ongoing maintenance.
    MaintenancePendingCount int
    Number of hosts in the sub-block that have pending maintenance.
    SchedulingType string
    The type of maintenance for the reservation.
    SubblockInfraMaintenanceOngoingCount int
    Number of sub-block infrastructure that has ongoing maintenance.
    SubblockInfraMaintenancePendingCount int
    Number of sub-block infrastructure that has pending maintenance.
    InstanceMaintenanceOngoingCount int
    Number of instances that have ongoing maintenance.
    InstanceMaintenancePendingCount int
    Number of instances that have pending maintenance.
    MaintenanceOngoingCount int
    Number of hosts in the sub-block that have ongoing maintenance.
    MaintenancePendingCount int
    Number of hosts in the sub-block that have pending maintenance.
    SchedulingType string
    The type of maintenance for the reservation.
    SubblockInfraMaintenanceOngoingCount int
    Number of sub-block infrastructure that has ongoing maintenance.
    SubblockInfraMaintenancePendingCount int
    Number of sub-block infrastructure that has pending maintenance.
    instanceMaintenanceOngoingCount Integer
    Number of instances that have ongoing maintenance.
    instanceMaintenancePendingCount Integer
    Number of instances that have pending maintenance.
    maintenanceOngoingCount Integer
    Number of hosts in the sub-block that have ongoing maintenance.
    maintenancePendingCount Integer
    Number of hosts in the sub-block that have pending maintenance.
    schedulingType String
    The type of maintenance for the reservation.
    subblockInfraMaintenanceOngoingCount Integer
    Number of sub-block infrastructure that has ongoing maintenance.
    subblockInfraMaintenancePendingCount Integer
    Number of sub-block infrastructure that has pending maintenance.
    instanceMaintenanceOngoingCount number
    Number of instances that have ongoing maintenance.
    instanceMaintenancePendingCount number
    Number of instances that have pending maintenance.
    maintenanceOngoingCount number
    Number of hosts in the sub-block that have ongoing maintenance.
    maintenancePendingCount number
    Number of hosts in the sub-block that have pending maintenance.
    schedulingType string
    The type of maintenance for the reservation.
    subblockInfraMaintenanceOngoingCount number
    Number of sub-block infrastructure that has ongoing maintenance.
    subblockInfraMaintenancePendingCount number
    Number of sub-block infrastructure that has pending maintenance.
    instance_maintenance_ongoing_count int
    Number of instances that have ongoing maintenance.
    instance_maintenance_pending_count int
    Number of instances that have pending maintenance.
    maintenance_ongoing_count int
    Number of hosts in the sub-block that have ongoing maintenance.
    maintenance_pending_count int
    Number of hosts in the sub-block that have pending maintenance.
    scheduling_type str
    The type of maintenance for the reservation.
    subblock_infra_maintenance_ongoing_count int
    Number of sub-block infrastructure that has ongoing maintenance.
    subblock_infra_maintenance_pending_count int
    Number of sub-block infrastructure that has pending maintenance.
    instanceMaintenanceOngoingCount Number
    Number of instances that have ongoing maintenance.
    instanceMaintenancePendingCount Number
    Number of instances that have pending maintenance.
    maintenanceOngoingCount Number
    Number of hosts in the sub-block that have ongoing maintenance.
    maintenancePendingCount Number
    Number of hosts in the sub-block that have pending maintenance.
    schedulingType String
    The type of maintenance for the reservation.
    subblockInfraMaintenanceOngoingCount Number
    Number of sub-block infrastructure that has ongoing maintenance.
    subblockInfraMaintenancePendingCount Number
    Number of sub-block infrastructure that has pending maintenance.

    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.
    gcp logo
    Google Cloud v9.6.0 published on Wednesday, Nov 26, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate