gcp.compute.getReservation
Explore with Pulumi AI
Provides access to available Google Compute Reservation Resources for a given project. See more about Reservations of Compute Engine resources in the upstream docs.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const reservation = gcp.compute.getReservation({
    name: "gce-reservation",
    zone: "us-central1-a",
});
import pulumi
import pulumi_gcp as gcp
reservation = gcp.compute.get_reservation(name="gce-reservation",
    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.LookupReservation(ctx, &compute.LookupReservationArgs{
			Name: "gce-reservation",
			Zone: "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 reservation = Gcp.Compute.GetReservation.Invoke(new()
    {
        Name = "gce-reservation",
        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.GetReservationArgs;
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 reservation = ComputeFunctions.getReservation(GetReservationArgs.builder()
            .name("gce-reservation")
            .zone("us-central1-a")
            .build());
    }
}
variables:
  reservation:
    fn::invoke:
      function: gcp:compute:getReservation
      arguments:
        name: gce-reservation
        zone: us-central1-a
Using getReservation
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 getReservation(args: GetReservationArgs, opts?: InvokeOptions): Promise<GetReservationResult>
function getReservationOutput(args: GetReservationOutputArgs, opts?: InvokeOptions): Output<GetReservationResult>def get_reservation(name: Optional[str] = None,
                    project: Optional[str] = None,
                    zone: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetReservationResult
def get_reservation_output(name: Optional[pulumi.Input[str]] = None,
                    project: Optional[pulumi.Input[str]] = None,
                    zone: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetReservationResult]func LookupReservation(ctx *Context, args *LookupReservationArgs, opts ...InvokeOption) (*LookupReservationResult, error)
func LookupReservationOutput(ctx *Context, args *LookupReservationOutputArgs, opts ...InvokeOption) LookupReservationResultOutput> Note: This function is named LookupReservation in the Go SDK.
public static class GetReservation 
{
    public static Task<GetReservationResult> InvokeAsync(GetReservationArgs args, InvokeOptions? opts = null)
    public static Output<GetReservationResult> Invoke(GetReservationInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetReservationResult> getReservation(GetReservationArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gcp:compute/getReservation:getReservation
  arguments:
    # arguments dictionaryThe following arguments are supported:
getReservation Result
The following output properties are available:
- Commitment string
 - Creation
Timestamp string - Description string
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Name string
 - Self
Link string - 
List<Get
Reservation Share Setting>  - Specific
Reservation boolRequired  - Specific
Reservations List<GetReservation Specific Reservation>  - Status string
 - Zone string
 - Project string
 
- Commitment string
 - Creation
Timestamp string - Description string
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Name string
 - Self
Link string - 
[]Get
Reservation Share Setting  - Specific
Reservation boolRequired  - Specific
Reservations []GetReservation Specific Reservation  - Status string
 - Zone string
 - Project string
 
- commitment String
 - creation
Timestamp String - description String
 - id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - self
Link String - 
List<Get
Reservation Share Setting>  - specific
Reservation BooleanRequired  - specific
Reservations List<GetReservation Specific Reservation>  - status String
 - zone String
 - project String
 
- commitment string
 - creation
Timestamp string - description string
 - id string
 - The provider-assigned unique ID for this managed resource.
 - name string
 - self
Link string - 
Get
Reservation Share Setting[]  - specific
Reservation booleanRequired  - specific
Reservations GetReservation Specific Reservation[]  - status string
 - zone string
 - project string
 
- commitment str
 - creation_
timestamp str - description str
 - id str
 - The provider-assigned unique ID for this managed resource.
 - name str
 - self_
link str - 
Sequence[Get
Reservation Share Setting]  - specific_
reservation_ boolrequired  - specific_
reservations Sequence[GetReservation Specific Reservation]  - status str
 - zone str
 - project str
 
- commitment String
 - creation
Timestamp String - description String
 - id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - self
Link String - List<Property Map>
 - specific
Reservation BooleanRequired  - specific
Reservations List<Property Map> - status String
 - zone String
 - project String
 
Supporting Types
GetReservationShareSetting   
- Project
Maps List<GetReservation Share Setting Project Map>  - A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
 - string
 - Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
 
- Project
Maps []GetReservation Share Setting Project Map  - A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
 - string
 - Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
 
- project
Maps List<GetReservation Share Setting Project Map>  - A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
 - String
 - Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
 
- project
Maps GetReservation Share Setting Project Map[]  - A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
 - string
 - Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
 
- project_
maps Sequence[GetReservation Share Setting Project Map]  - A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
 - str
 - Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
 
- project
Maps List<Property Map> - A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
 - String
 - Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
 
GetReservationShareSettingProjectMap     
- id str
 - project_
id str - The project id/number, should be same as the key of this project config in the project map.
 
GetReservationSpecificReservation   
- Count int
 - The number of resources that are allocated.
 - In
Use intCount  - How many instances are in use.
 - Instance
Properties List<GetReservation Specific Reservation Instance Property>  - The instance properties for the reservation.
 
- Count int
 - The number of resources that are allocated.
 - In
Use intCount  - How many instances are in use.
 - Instance
Properties []GetReservation Specific Reservation Instance Property  - The instance properties for the reservation.
 
- count Integer
 - The number of resources that are allocated.
 - in
Use IntegerCount  - How many instances are in use.
 - instance
Properties List<GetReservation Specific Reservation Instance Property>  - The instance properties for the reservation.
 
- count number
 - The number of resources that are allocated.
 - in
Use numberCount  - How many instances are in use.
 - instance
Properties GetReservation Specific Reservation Instance Property[]  - The instance properties for the reservation.
 
- count int
 - The number of resources that are allocated.
 - in_
use_ intcount  - How many instances are in use.
 - instance_
properties Sequence[GetReservation Specific Reservation Instance Property]  - The instance properties for the reservation.
 
- count Number
 - The number of resources that are allocated.
 - in
Use NumberCount  - How many instances are in use.
 - instance
Properties List<Property Map> - The instance properties for the reservation.
 
GetReservationSpecificReservationInstanceProperty     
- Guest
Accelerators List<GetReservation Specific Reservation Instance Property Guest Accelerator>  - Guest accelerator type and count.
 - Local
Ssds List<GetReservation Specific Reservation Instance Property Local Ssd>  - The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
 - Machine
Type string - The name of the machine type to reserve.
 - Min
Cpu stringPlatform  - The minimum CPU platform for the reservation. For example, '"Intel Skylake"'. See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
 
- Guest
Accelerators []GetReservation Specific Reservation Instance Property Guest Accelerator  - Guest accelerator type and count.
 - Local
Ssds []GetReservation Specific Reservation Instance Property Local Ssd  - The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
 - Machine
Type string - The name of the machine type to reserve.
 - Min
Cpu stringPlatform  - The minimum CPU platform for the reservation. For example, '"Intel Skylake"'. See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
 
- guest
Accelerators List<GetReservation Specific Reservation Instance Property Guest Accelerator>  - Guest accelerator type and count.
 - local
Ssds List<GetReservation Specific Reservation Instance Property Local Ssd>  - The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
 - machine
Type String - The name of the machine type to reserve.
 - min
Cpu StringPlatform  - The minimum CPU platform for the reservation. For example, '"Intel Skylake"'. See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
 
- guest
Accelerators GetReservation Specific Reservation Instance Property Guest Accelerator[]  - Guest accelerator type and count.
 - local
Ssds GetReservation Specific Reservation Instance Property Local Ssd[]  - The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
 - machine
Type string - The name of the machine type to reserve.
 - min
Cpu stringPlatform  - The minimum CPU platform for the reservation. For example, '"Intel Skylake"'. See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
 
- guest_
accelerators Sequence[GetReservation Specific Reservation Instance Property Guest Accelerator]  - Guest accelerator type and count.
 - local_
ssds Sequence[GetReservation Specific Reservation Instance Property Local Ssd]  - The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
 - machine_
type str - The name of the machine type to reserve.
 - min_
cpu_ strplatform  - The minimum CPU platform for the reservation. For example, '"Intel Skylake"'. See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
 
- guest
Accelerators List<Property Map> - Guest accelerator type and count.
 - local
Ssds List<Property Map> - The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
 - machine
Type String - The name of the machine type to reserve.
 - min
Cpu StringPlatform  - The minimum CPU platform for the reservation. For example, '"Intel Skylake"'. See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
 
GetReservationSpecificReservationInstancePropertyGuestAccelerator       
- Accelerator
Count int - The number of the guest accelerator cards exposed to this instance.
 - Accelerator
Type string The full or partial URL of the accelerator type to attach to this instance. For example: 'projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100'
If you are creating an instance template, specify only the accelerator name.
- Accelerator
Count int - The number of the guest accelerator cards exposed to this instance.
 - Accelerator
Type string The full or partial URL of the accelerator type to attach to this instance. For example: 'projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100'
If you are creating an instance template, specify only the accelerator name.
- accelerator
Count Integer - The number of the guest accelerator cards exposed to this instance.
 - accelerator
Type String The full or partial URL of the accelerator type to attach to this instance. For example: 'projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100'
If you are creating an instance template, specify only the accelerator name.
- accelerator
Count number - The number of the guest accelerator cards exposed to this instance.
 - accelerator
Type string The full or partial URL of the accelerator type to attach to this instance. For example: 'projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100'
If you are creating an instance template, specify only the accelerator name.
- accelerator_
count int - The number of the guest accelerator cards exposed to this instance.
 - accelerator_
type str The full or partial URL of the accelerator type to attach to this instance. For example: 'projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100'
If you are creating an instance template, specify only the accelerator name.
- accelerator
Count Number - The number of the guest accelerator cards exposed to this instance.
 - accelerator
Type String The full or partial URL of the accelerator type to attach to this instance. For example: 'projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100'
If you are creating an instance template, specify only the accelerator name.
GetReservationSpecificReservationInstancePropertyLocalSsd       
- Disk
Size intGb  - The size of the disk in base-2 GB.
 - Interface string
 - The disk interface to use for attaching this disk. Default value: "SCSI" Possible values: ["SCSI", "NVME"]
 
- Disk
Size intGb  - The size of the disk in base-2 GB.
 - Interface string
 - The disk interface to use for attaching this disk. Default value: "SCSI" Possible values: ["SCSI", "NVME"]
 
- disk
Size IntegerGb  - The size of the disk in base-2 GB.
 - interface_ String
 - The disk interface to use for attaching this disk. Default value: "SCSI" Possible values: ["SCSI", "NVME"]
 
- disk
Size numberGb  - The size of the disk in base-2 GB.
 - interface string
 - The disk interface to use for attaching this disk. Default value: "SCSI" Possible values: ["SCSI", "NVME"]
 
- disk_
size_ intgb  - The size of the disk in base-2 GB.
 - interface str
 - The disk interface to use for attaching this disk. Default value: "SCSI" Possible values: ["SCSI", "NVME"]
 
- disk
Size NumberGb  - The size of the disk in base-2 GB.
 - interface String
 - The disk interface to use for attaching this disk. Default value: "SCSI" Possible values: ["SCSI", "NVME"]
 
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.