1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getReservationBlock
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 Block. Reservation blocks are automatically created by Google Cloud within reservations and represent a 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 block = gcp.compute.getReservationBlock({
        name: "my-reservation-block",
        reservation: "my-reservation",
        zone: "us-central1-a",
    });
    export const blockStatus = block.then(block => block.status);
    export const blockInUseCount = block.then(block => block.inUseCount);
    
    import pulumi
    import pulumi_gcp as gcp
    
    block = gcp.compute.get_reservation_block(name="my-reservation-block",
        reservation="my-reservation",
        zone="us-central1-a")
    pulumi.export("blockStatus", block.status)
    pulumi.export("blockInUseCount", block.in_use_count)
    
    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 {
    		block, err := compute.GetReservationBlock(ctx, &compute.GetReservationBlockArgs{
    			Name:        "my-reservation-block",
    			Reservation: "my-reservation",
    			Zone:        pulumi.StringRef("us-central1-a"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("blockStatus", block.Status)
    		ctx.Export("blockInUseCount", block.InUseCount)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var block = Gcp.Compute.GetReservationBlock.Invoke(new()
        {
            Name = "my-reservation-block",
            Reservation = "my-reservation",
            Zone = "us-central1-a",
        });
    
        return new Dictionary<string, object?>
        {
            ["blockStatus"] = block.Apply(getReservationBlockResult => getReservationBlockResult.Status),
            ["blockInUseCount"] = block.Apply(getReservationBlockResult => getReservationBlockResult.InUseCount),
        };
    });
    
    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.GetReservationBlockArgs;
    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 block = ComputeFunctions.getReservationBlock(GetReservationBlockArgs.builder()
                .name("my-reservation-block")
                .reservation("my-reservation")
                .zone("us-central1-a")
                .build());
    
            ctx.export("blockStatus", block.status());
            ctx.export("blockInUseCount", block.inUseCount());
        }
    }
    
    variables:
      block:
        fn::invoke:
          function: gcp:compute:getReservationBlock
          arguments:
            name: my-reservation-block
            reservation: my-reservation
            zone: us-central1-a
    outputs:
      blockStatus: ${block.status}
      blockInUseCount: ${block.inUseCount}
    

    Using getReservationBlock

    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 getReservationBlock(args: GetReservationBlockArgs, opts?: InvokeOptions): Promise<GetReservationBlockResult>
    function getReservationBlockOutput(args: GetReservationBlockOutputArgs, opts?: InvokeOptions): Output<GetReservationBlockResult>
    def get_reservation_block(name: Optional[str] = None,
                              project: Optional[str] = None,
                              reservation: Optional[str] = None,
                              zone: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetReservationBlockResult
    def get_reservation_block_output(name: Optional[pulumi.Input[str]] = None,
                              project: Optional[pulumi.Input[str]] = None,
                              reservation: Optional[pulumi.Input[str]] = None,
                              zone: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetReservationBlockResult]
    func GetReservationBlock(ctx *Context, args *GetReservationBlockArgs, opts ...InvokeOption) (*GetReservationBlockResult, error)
    func GetReservationBlockOutput(ctx *Context, args *GetReservationBlockOutputArgs, opts ...InvokeOption) GetReservationBlockResultOutput

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

    public static class GetReservationBlock 
    {
        public static Task<GetReservationBlockResult> InvokeAsync(GetReservationBlockArgs args, InvokeOptions? opts = null)
        public static Output<GetReservationBlockResult> Invoke(GetReservationBlockInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetReservationBlockResult> getReservationBlock(GetReservationBlockArgs args, InvokeOptions options)
    public static Output<GetReservationBlockResult> getReservationBlock(GetReservationBlockArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:compute/getReservationBlock:getReservationBlock
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the reservation block.
    Reservation string
    The name of the parent reservation.
    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 block resides.


    Name string
    The name of the reservation block.
    Reservation string
    The name of the parent reservation.
    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 block resides.


    name String
    The name of the reservation block.
    reservation String
    The name of the parent reservation.
    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 block resides.


    name string
    The name of the reservation block.
    reservation string
    The name of the parent reservation.
    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 block resides.


    name str
    The name of the reservation block.
    reservation str
    The name of the parent reservation.
    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 block resides.


    name String
    The name of the reservation block.
    reservation String
    The name of the parent reservation.
    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 block resides.


    getReservationBlock Result

    The following output properties are available:

    BlockCount int
    The number of resources that are allocated in this reservation block.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    HealthInfos List<GetReservationBlockHealthInfo>
    Health information for the reservation 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 block.
    Kind string
    Type of the resource. Always compute#reservationBlock for reservation blocks.
    Name string
    PhysicalTopologies List<GetReservationBlockPhysicalTopology>
    The physical topology of the reservation block. Structure is documented below.
    Project string
    Reservation string
    ReservationMaintenances List<GetReservationBlockReservationMaintenance>
    Maintenance information for this reservation block. Structure is documented below.
    ReservationSubBlockCount int
    The number of reservation sub-blocks associated with this reservation block.
    ReservationSubBlockInUseCount int
    The number of in-use reservation sub-blocks associated with this reservation block.
    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 block.
    SubBlockNames List<string>
    A List of all block sub-block names in the parent block.
    Zone string
    BlockCount int
    The number of resources that are allocated in this reservation block.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    HealthInfos []GetReservationBlockHealthInfo
    Health information for the reservation 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 block.
    Kind string
    Type of the resource. Always compute#reservationBlock for reservation blocks.
    Name string
    PhysicalTopologies []GetReservationBlockPhysicalTopology
    The physical topology of the reservation block. Structure is documented below.
    Project string
    Reservation string
    ReservationMaintenances []GetReservationBlockReservationMaintenance
    Maintenance information for this reservation block. Structure is documented below.
    ReservationSubBlockCount int
    The number of reservation sub-blocks associated with this reservation block.
    ReservationSubBlockInUseCount int
    The number of in-use reservation sub-blocks associated with this reservation block.
    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 block.
    SubBlockNames []string
    A List of all block sub-block names in the parent block.
    Zone string
    blockCount Integer
    The number of resources that are allocated in this reservation block.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    healthInfos List<GetReservationBlockHealthInfo>
    Health information for the reservation 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 block.
    kind String
    Type of the resource. Always compute#reservationBlock for reservation blocks.
    name String
    physicalTopologies List<GetReservationBlockPhysicalTopology>
    The physical topology of the reservation block. Structure is documented below.
    project String
    reservation String
    reservationMaintenances List<GetReservationBlockReservationMaintenance>
    Maintenance information for this reservation block. Structure is documented below.
    reservationSubBlockCount Integer
    The number of reservation sub-blocks associated with this reservation block.
    reservationSubBlockInUseCount Integer
    The number of in-use reservation sub-blocks associated with this reservation block.
    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 block.
    subBlockNames List<String>
    A List of all block sub-block names in the parent block.
    zone String
    blockCount number
    The number of resources that are allocated in this reservation block.
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    healthInfos GetReservationBlockHealthInfo[]
    Health information for the reservation 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 block.
    kind string
    Type of the resource. Always compute#reservationBlock for reservation blocks.
    name string
    physicalTopologies GetReservationBlockPhysicalTopology[]
    The physical topology of the reservation block. Structure is documented below.
    project string
    reservation string
    reservationMaintenances GetReservationBlockReservationMaintenance[]
    Maintenance information for this reservation block. Structure is documented below.
    reservationSubBlockCount number
    The number of reservation sub-blocks associated with this reservation block.
    reservationSubBlockInUseCount number
    The number of in-use reservation sub-blocks associated with this reservation block.
    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 block.
    subBlockNames string[]
    A List of all block sub-block names in the parent block.
    zone string
    block_count int
    The number of resources that are allocated in this reservation block.
    creation_timestamp str
    Creation timestamp in RFC3339 text format.
    health_infos Sequence[GetReservationBlockHealthInfo]
    Health information for the reservation 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 block.
    kind str
    Type of the resource. Always compute#reservationBlock for reservation blocks.
    name str
    physical_topologies Sequence[GetReservationBlockPhysicalTopology]
    The physical topology of the reservation block. Structure is documented below.
    project str
    reservation str
    reservation_maintenances Sequence[GetReservationBlockReservationMaintenance]
    Maintenance information for this reservation block. Structure is documented below.
    reservation_sub_block_count int
    The number of reservation sub-blocks associated with this reservation block.
    reservation_sub_block_in_use_count int
    The number of in-use reservation sub-blocks associated with this reservation block.
    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 block.
    sub_block_names Sequence[str]
    A List of all block sub-block names in the parent block.
    zone str
    blockCount Number
    The number of resources that are allocated in this reservation block.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    healthInfos List<Property Map>
    Health information for the reservation 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 block.
    kind String
    Type of the resource. Always compute#reservationBlock for reservation blocks.
    name String
    physicalTopologies List<Property Map>
    The physical topology of the reservation block. Structure is documented below.
    project String
    reservation String
    reservationMaintenances List<Property Map>
    Maintenance information for this reservation block. Structure is documented below.
    reservationSubBlockCount Number
    The number of reservation sub-blocks associated with this reservation block.
    reservationSubBlockInUseCount Number
    The number of in-use reservation sub-blocks associated with this reservation block.
    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 block.
    subBlockNames List<String>
    A List of all block sub-block names in the parent block.
    zone String

    Supporting Types

    GetReservationBlockHealthInfo

    DegradedSubBlockCount int
    The number of sub-blocks that are degraded.
    HealthStatus string
    The health status of the reservation block.
    HealthySubBlockCount int
    The number of sub-blocks that are healthy.
    DegradedSubBlockCount int
    The number of sub-blocks that are degraded.
    HealthStatus string
    The health status of the reservation block.
    HealthySubBlockCount int
    The number of sub-blocks that are healthy.
    degradedSubBlockCount Integer
    The number of sub-blocks that are degraded.
    healthStatus String
    The health status of the reservation block.
    healthySubBlockCount Integer
    The number of sub-blocks that are healthy.
    degradedSubBlockCount number
    The number of sub-blocks that are degraded.
    healthStatus string
    The health status of the reservation block.
    healthySubBlockCount number
    The number of sub-blocks that are healthy.
    degraded_sub_block_count int
    The number of sub-blocks that are degraded.
    health_status str
    The health status of the reservation block.
    healthy_sub_block_count int
    The number of sub-blocks that are healthy.
    degradedSubBlockCount Number
    The number of sub-blocks that are degraded.
    healthStatus String
    The health status of the reservation block.
    healthySubBlockCount Number
    The number of sub-blocks that are healthy.

    GetReservationBlockPhysicalTopology

    Block string
    The hash of the capacity block within the cluster.
    Cluster string
    The cluster name of the reservation block.
    Block string
    The hash of the capacity block within the cluster.
    Cluster string
    The cluster name of the reservation block.
    block String
    The hash of the capacity block within the cluster.
    cluster String
    The cluster name of the reservation block.
    block string
    The hash of the capacity block within the cluster.
    cluster string
    The cluster name of the reservation block.
    block str
    The hash of the capacity block within the cluster.
    cluster str
    The cluster name of the reservation block.
    block String
    The hash of the capacity block within the cluster.
    cluster String
    The cluster name of the reservation block.

    GetReservationBlockReservationMaintenance

    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 block that have ongoing maintenance.
    MaintenancePendingCount int
    Number of hosts in the 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 block that have ongoing maintenance.
    MaintenancePendingCount int
    Number of hosts in the 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 block that have ongoing maintenance.
    maintenancePendingCount Integer
    Number of hosts in the 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 block that have ongoing maintenance.
    maintenancePendingCount number
    Number of hosts in the 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 block that have ongoing maintenance.
    maintenance_pending_count int
    Number of hosts in the 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 block that have ongoing maintenance.
    maintenancePendingCount Number
    Number of hosts in the 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