Reservation
Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running.
Reservations apply only to Compute Engine, Cloud Dataproc, and Google
Kubernetes Engine VM usage.Reservations do not apply to f1-micro or
g1-small machine types, preemptible VMs, sole tenant nodes, or other
services not listed above
like Cloud SQL and Dataflow.
To get more information about Reservation, see:
- API documentation
- How-to Guides
Create a Reservation Resource
new Reservation(name: string, args: ReservationArgs, opts?: CustomResourceOptions);def Reservation(resource_name, opts=None, description=None, name=None, project=None, specific_reservation=None, specific_reservation_required=None, zone=None, __props__=None);func NewReservation(ctx *Context, name string, args ReservationArgs, opts ...ResourceOption) (*Reservation, error)public Reservation(string name, ReservationArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ReservationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ReservationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ReservationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Reservation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Reservation resource accepts the following input properties:
- Specific
Reservation ReservationSpecific Reservation Args Reservation for instances with specific machine shapes. Structure is documented below.
- Zone string
The zone where the reservation is made.
- Description string
An optional description of this resource.
- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Specific
Reservation boolRequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
- Specific
Reservation ReservationSpecific Reservation Reservation for instances with specific machine shapes. Structure is documented below.
- Zone string
The zone where the reservation is made.
- Description string
An optional description of this resource.
- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Specific
Reservation boolRequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
- specific
Reservation ReservationSpecific Reservation Reservation for instances with specific machine shapes. Structure is documented below.
- zone string
The zone where the reservation is made.
- description string
An optional description of this resource.
- name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- specific
Reservation booleanRequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
- specific_
reservation Dict[ReservationSpecific Reservation] Reservation for instances with specific machine shapes. Structure is documented below.
- zone str
The zone where the reservation is made.
- description str
An optional description of this resource.
- name str
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- specific_
reservation_ boolrequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
Outputs
All input properties are implicitly available as output properties. Additionally, the Reservation resource produces the following output properties:
- Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Self
Link string The URI of the created resource.
- Status string
The status of the reservation.
- Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Self
Link string The URI of the created resource.
- Status string
The status of the reservation.
- commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- id string
- The provider-assigned unique ID for this managed resource.
- self
Link string The URI of the created resource.
- status string
The status of the reservation.
- commitment str
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- creation_
timestamp str Creation timestamp in RFC3339 text format.
- id str
- The provider-assigned unique ID for this managed resource.
- self_
link str The URI of the created resource.
- status str
The status of the reservation.
Look up an Existing Reservation Resource
Get an existing Reservation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ReservationState, opts?: CustomResourceOptions): Reservationstatic get(resource_name, id, opts=None, commitment=None, creation_timestamp=None, description=None, name=None, project=None, self_link=None, specific_reservation=None, specific_reservation_required=None, status=None, zone=None, __props__=None);func GetReservation(ctx *Context, name string, id IDInput, state *ReservationState, opts ...ResourceOption) (*Reservation, error)public static Reservation Get(string name, Input<string> id, ReservationState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource.
- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Self
Link string The URI of the created resource.
- Specific
Reservation ReservationSpecific Reservation Args Reservation for instances with specific machine shapes. Structure is documented below.
- Specific
Reservation boolRequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
- Status string
The status of the reservation.
- Zone string
The zone where the reservation is made.
- Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource.
- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Self
Link string The URI of the created resource.
- Specific
Reservation ReservationSpecific Reservation Reservation for instances with specific machine shapes. Structure is documented below.
- Specific
Reservation boolRequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
- Status string
The status of the reservation.
- Zone string
The zone where the reservation is made.
- commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- description string
An optional description of this resource.
- name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- self
Link string The URI of the created resource.
- specific
Reservation ReservationSpecific Reservation Reservation for instances with specific machine shapes. Structure is documented below.
- specific
Reservation booleanRequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
- status string
The status of the reservation.
- zone string
The zone where the reservation is made.
- commitment str
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
- creation_
timestamp str Creation timestamp in RFC3339 text format.
- description str
An optional description of this resource.
- name str
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- self_
link str The URI of the created resource.
- specific_
reservation Dict[ReservationSpecific Reservation] Reservation for instances with specific machine shapes. Structure is documented below.
- specific_
reservation_ boolrequired When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
- status str
The status of the reservation.
- zone str
The zone where the reservation is made.
Supporting Types
ReservationSpecificReservation
- Count int
The number of resources that are allocated.
- Instance
Properties ReservationSpecific Reservation Instance Properties Args The instance properties for the reservation. Structure is documented below.
- In
Use intCount - How many instances are in use.
- Count int
The number of resources that are allocated.
- Instance
Properties ReservationSpecific Reservation Instance Properties The instance properties for the reservation. Structure is documented below.
- In
Use intCount - How many instances are in use.
- count number
The number of resources that are allocated.
- instance
Properties ReservationSpecific Reservation Instance Properties The instance properties for the reservation. Structure is documented below.
- in
Use numberCount - How many instances are in use.
- count float
The number of resources that are allocated.
- instance
Properties Dict[ReservationSpecific Reservation Instance Properties] The instance properties for the reservation. Structure is documented below.
- in
Use floatCount - How many instances are in use.
ReservationSpecificReservationInstanceProperties
- Machine
Type string The name of the machine type to reserve.
- Guest
Accelerators List<ReservationSpecific Reservation Instance Properties Guest Accelerator Args> Guest accelerator type and count. Structure is documented below.
- Local
Ssds List<ReservationSpecific Reservation Instance Properties Local Ssd Args> The amount of local ssd to reserve with each instance. This reserves disks of type
local-ssd. Structure is documented below.- 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.
- Machine
Type string The name of the machine type to reserve.
- Guest
Accelerators []ReservationSpecific Reservation Instance Properties Guest Accelerator Guest accelerator type and count. Structure is documented below.
- Local
Ssds []ReservationSpecific Reservation Instance Properties Local Ssd The amount of local ssd to reserve with each instance. This reserves disks of type
local-ssd. Structure is documented below.- 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.
- machine
Type string The name of the machine type to reserve.
- guest
Accelerators ReservationSpecific Reservation Instance Properties Guest Accelerator[] Guest accelerator type and count. Structure is documented below.
- local
Ssds ReservationSpecific Reservation Instance Properties Local Ssd[] The amount of local ssd to reserve with each instance. This reserves disks of type
local-ssd. Structure is documented below.- 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.
- machine_
type str The name of the machine type to reserve.
- guest_
accelerators List[ReservationSpecific Reservation Instance Properties Guest Accelerator] Guest accelerator type and count. Structure is documented below.
- local
Ssds List[ReservationSpecific Reservation Instance Properties Local Ssd] The amount of local ssd to reserve with each instance. This reserves disks of type
local-ssd. Structure is documented below.- 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.
ReservationSpecificReservationInstancePropertiesGuestAccelerator
- 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-p100If 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-p100If 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-p100If you are creating an instance template, specify only the accelerator name.
- accelerator
Count float 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-p100If you are creating an instance template, specify only the accelerator name.
ReservationSpecificReservationInstancePropertiesLocalSsd
- Disk
Size intGb The size of the disk in base-2 GB.
- Interface string
The disk interface to use for attaching this disk.
- Disk
Size intGb The size of the disk in base-2 GB.
- Interface string
The disk interface to use for attaching this disk.
- disk
Size numberGb The size of the disk in base-2 GB.
- interface string
The disk interface to use for attaching this disk.
- disk_
size_ floatgb The size of the disk in base-2 GB.
- interface str
The disk interface to use for attaching this disk.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.