1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getReservation
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

gcp.compute.getReservation

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

    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/v7/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 dictionary

    The following arguments are supported:

    Name string
    The name of the Compute Reservation.
    Zone string
    Zone where the Compute Reservation resides.
    Project string
    Project from which to list the Compute Reservation. Defaults to project declared in the provider.
    Name string
    The name of the Compute Reservation.
    Zone string
    Zone where the Compute Reservation resides.
    Project string
    Project from which to list the Compute Reservation. Defaults to project declared in the provider.
    name String
    The name of the Compute Reservation.
    zone String
    Zone where the Compute Reservation resides.
    project String
    Project from which to list the Compute Reservation. Defaults to project declared in the provider.
    name string
    The name of the Compute Reservation.
    zone string
    Zone where the Compute Reservation resides.
    project string
    Project from which to list the Compute Reservation. Defaults to project declared in the provider.
    name str
    The name of the Compute Reservation.
    zone str
    Zone where the Compute Reservation resides.
    project str
    Project from which to list the Compute Reservation. Defaults to project declared in the provider.
    name String
    The name of the Compute Reservation.
    zone String
    Zone where the Compute Reservation resides.
    project String
    Project from which to list the Compute Reservation. Defaults to project declared in the provider.

    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
    ShareSettings []GetReservationShareSetting
    SpecificReservationRequired bool
    SpecificReservations []GetReservationSpecificReservation
    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
    shareSettings GetReservationShareSetting[]
    specificReservationRequired boolean
    specificReservations GetReservationSpecificReservation[]
    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
    shareSettings List<Property Map>
    specificReservationRequired Boolean
    specificReservations List<Property Map>
    status String
    zone String
    project String

    Supporting Types

    GetReservationShareSetting

    ProjectMaps List<GetReservationShareSettingProjectMap>
    A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
    ShareType string
    Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
    ProjectMaps []GetReservationShareSettingProjectMap
    A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
    ShareType string
    Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
    projectMaps List<GetReservationShareSettingProjectMap>
    A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
    shareType String
    Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
    projectMaps GetReservationShareSettingProjectMap[]
    A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
    shareType string
    Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]
    project_maps Sequence[GetReservationShareSettingProjectMap]
    A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS.
    share_type 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.
    shareType String
    Type of sharing for this shared-reservation Possible values: ["LOCAL", "SPECIFIC_PROJECTS"]

    GetReservationShareSettingProjectMap

    Id string
    ProjectId string
    The project id/number, should be same as the key of this project config in the project map.
    Id string
    ProjectId string
    The project id/number, should be same as the key of this project config in the project map.
    id String
    projectId String
    The project id/number, should be same as the key of this project config in the project map.
    id string
    projectId string
    The project id/number, should be same as the key of this project config in the project map.
    id str
    project_id str
    The project id/number, should be same as the key of this project config in the project map.
    id String
    projectId String
    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.
    InUseCount int
    How many instances are in use.
    InstanceProperties List<GetReservationSpecificReservationInstanceProperty>
    The instance properties for the reservation.
    Count int
    The number of resources that are allocated.
    InUseCount int
    How many instances are in use.
    InstanceProperties []GetReservationSpecificReservationInstanceProperty
    The instance properties for the reservation.
    count Integer
    The number of resources that are allocated.
    inUseCount Integer
    How many instances are in use.
    instanceProperties List<GetReservationSpecificReservationInstanceProperty>
    The instance properties for the reservation.
    count number
    The number of resources that are allocated.
    inUseCount number
    How many instances are in use.
    instanceProperties GetReservationSpecificReservationInstanceProperty[]
    The instance properties for the reservation.
    count int
    The number of resources that are allocated.
    in_use_count int
    How many instances are in use.
    instance_properties Sequence[GetReservationSpecificReservationInstanceProperty]
    The instance properties for the reservation.
    count Number
    The number of resources that are allocated.
    inUseCount Number
    How many instances are in use.
    instanceProperties List<Property Map>
    The instance properties for the reservation.

    GetReservationSpecificReservationInstanceProperty

    GuestAccelerators List<GetReservationSpecificReservationInstancePropertyGuestAccelerator>
    Guest accelerator type and count.
    LocalSsds List<GetReservationSpecificReservationInstancePropertyLocalSsd>
    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.
    MinCpuPlatform string
    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 []GetReservationSpecificReservationInstancePropertyGuestAccelerator
    Guest accelerator type and count.
    LocalSsds []GetReservationSpecificReservationInstancePropertyLocalSsd
    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.
    MinCpuPlatform string
    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<GetReservationSpecificReservationInstancePropertyGuestAccelerator>
    Guest accelerator type and count.
    localSsds List<GetReservationSpecificReservationInstancePropertyLocalSsd>
    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.
    minCpuPlatform String
    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 GetReservationSpecificReservationInstancePropertyGuestAccelerator[]
    Guest accelerator type and count.
    localSsds GetReservationSpecificReservationInstancePropertyLocalSsd[]
    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.
    minCpuPlatform string
    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[GetReservationSpecificReservationInstancePropertyGuestAccelerator]
    Guest accelerator type and count.
    local_ssds Sequence[GetReservationSpecificReservationInstancePropertyLocalSsd]
    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_platform str
    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.
    minCpuPlatform String
    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

    DiskSizeGb int
    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"]
    DiskSizeGb int
    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"]
    diskSizeGb Integer
    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"]
    diskSizeGb number
    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_gb int
    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"]
    diskSizeGb Number
    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-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi