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)
public static Output<GetReservationResult> getReservation(GetReservationArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:compute/getReservation:getReservation
  arguments:
    # arguments dictionaryThe following arguments are supported:
getReservation Result
The following output properties are available:
- Commitment string
- CreationTimestamp string
- Description string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- SelfLink string
- 
List<GetReservation Share Setting> 
- SpecificReservation boolRequired 
- SpecificReservations List<GetReservation Specific Reservation> 
- Status string
- Zone string
- Project string
- Commitment string
- CreationTimestamp string
- Description string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- SelfLink string
- 
[]GetReservation Share Setting 
- SpecificReservation boolRequired 
- SpecificReservations []GetReservation Specific Reservation 
- Status string
- Zone string
- Project string
- commitment String
- creationTimestamp String
- description String
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- selfLink String
- 
List<GetReservation Share Setting> 
- specificReservation BooleanRequired 
- specificReservations List<GetReservation Specific Reservation> 
- status String
- zone String
- project String
- commitment string
- creationTimestamp string
- description string
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- selfLink string
- 
GetReservation Share Setting[] 
- specificReservation booleanRequired 
- specificReservations 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[GetReservation Share Setting] 
- specific_reservation_ boolrequired 
- specific_reservations Sequence[GetReservation Specific Reservation] 
- status str
- zone str
- project str
- commitment String
- creationTimestamp String
- description String
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- selfLink String
- List<Property Map>
- specificReservation BooleanRequired 
- specificReservations List<Property Map>
- status String
- zone String
- project String
Supporting Types
GetReservationShareSetting   
- ProjectMaps 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"]
- ProjectMaps []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"]
- projectMaps 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"]
- projectMaps 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"]
- projectMaps 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.
- InUse intCount 
- How many instances are in use.
- InstanceProperties List<GetReservation Specific Reservation Instance Property> 
- The instance properties for the reservation.
- Count int
- The number of resources that are allocated.
- InUse intCount 
- How many instances are in use.
- InstanceProperties []GetReservation Specific Reservation Instance Property 
- The instance properties for the reservation.
- count Integer
- The number of resources that are allocated.
- inUse IntegerCount 
- How many instances are in use.
- instanceProperties List<GetReservation Specific Reservation Instance Property> 
- The instance properties for the reservation.
- count number
- The number of resources that are allocated.
- inUse numberCount 
- How many instances are in use.
- instanceProperties 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.
- inUse NumberCount 
- How many instances are in use.
- instanceProperties List<Property Map>
- The instance properties for the reservation.
GetReservationSpecificReservationInstanceProperty     
- GuestAccelerators List<GetReservation Specific Reservation Instance Property Guest Accelerator> 
- Guest accelerator type and count.
- LocalSsds 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'.
- MachineType string
- The name of the machine type to reserve.
- MinCpu 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.
- GuestAccelerators []GetReservation Specific Reservation Instance Property Guest Accelerator 
- Guest accelerator type and count.
- LocalSsds []GetReservation Specific Reservation Instance Property Local Ssd 
- The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
- MachineType string
- The name of the machine type to reserve.
- MinCpu 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.
- guestAccelerators List<GetReservation Specific Reservation Instance Property Guest Accelerator> 
- Guest accelerator type and count.
- localSsds 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'.
- machineType String
- The name of the machine type to reserve.
- minCpu 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.
- guestAccelerators GetReservation Specific Reservation Instance Property Guest Accelerator[] 
- Guest accelerator type and count.
- localSsds GetReservation Specific Reservation Instance Property Local Ssd[] 
- The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
- machineType string
- The name of the machine type to reserve.
- minCpu 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.
- guestAccelerators List<Property Map>
- Guest accelerator type and count.
- localSsds List<Property Map>
- The amount of local ssd to reserve with each instance. This reserves disks of type 'local-ssd'.
- machineType String
- The name of the machine type to reserve.
- minCpu 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       
- AcceleratorCount int
- The number of the guest accelerator cards exposed to this instance.
- AcceleratorType 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. 
- AcceleratorCount int
- The number of the guest accelerator cards exposed to this instance.
- AcceleratorType 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. 
- acceleratorCount Integer
- The number of the guest accelerator cards exposed to this instance.
- acceleratorType 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. 
- acceleratorCount number
- The number of the guest accelerator cards exposed to this instance.
- acceleratorType 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. 
- acceleratorCount Number
- The number of the guest accelerator cards exposed to this instance.
- acceleratorType 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       
- DiskSize 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"]
- DiskSize 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"]
- diskSize 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"]
- diskSize 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"]
- diskSize 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.