All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.bigquery.kotlin.ReservationArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.20.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.bigquery.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.bigquery.ReservationArgs.builder
import com.pulumi.gcp.bigquery.kotlin.inputs.ReservationAutoscaleArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.ReservationAutoscaleArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * A reservation is a mechanism used to guarantee BigQuery slots to users.
 * To get more information about Reservation, see:
 * * [API documentation](https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/projects.locations.reservations/create)
 * * How-to Guides
 *     * [Introduction to Reservations](https://cloud.google.com/bigquery/docs/reservations-intro)
 * ## Example Usage
 * ### Bigquery Reservation Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const reservation = new gcp.bigquery.Reservation("reservation", {
 *     name: "my-reservation",
 *     location: "us-west2",
 *     slotCapacity: 0,
 *     edition: "STANDARD",
 *     ignoreIdleSlots: true,
 *     concurrency: 0,
 *     autoscale: {
 *         maxSlots: 100,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * reservation = gcp.bigquery.Reservation("reservation",
 *     name="my-reservation",
 *     location="us-west2",
 *     slot_capacity=0,
 *     edition="STANDARD",
 *     ignore_idle_slots=True,
 *     concurrency=0,
 *     autoscale={
 *         "max_slots": 100,
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var reservation = new Gcp.BigQuery.Reservation("reservation", new()
 *     {
 *         Name = "my-reservation",
 *         Location = "us-west2",
 *         SlotCapacity = 0,
 *         Edition = "STANDARD",
 *         IgnoreIdleSlots = true,
 *         Concurrency = 0,
 *         Autoscale = new Gcp.BigQuery.Inputs.ReservationAutoscaleArgs
 *         {
 *             MaxSlots = 100,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigquery"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := bigquery.NewReservation(ctx, "reservation", &bigquery.ReservationArgs{
 * 			Name:            pulumi.String("my-reservation"),
 * 			Location:        pulumi.String("us-west2"),
 * 			SlotCapacity:    pulumi.Int(0),
 * 			Edition:         pulumi.String("STANDARD"),
 * 			IgnoreIdleSlots: pulumi.Bool(true),
 * 			Concurrency:     pulumi.Int(0),
 * 			Autoscale: &bigquery.ReservationAutoscaleArgs{
 * 				MaxSlots: pulumi.Int(100),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.bigquery.Reservation;
 * import com.pulumi.gcp.bigquery.ReservationArgs;
 * import com.pulumi.gcp.bigquery.inputs.ReservationAutoscaleArgs;
 * 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) {
 *         var reservation = new Reservation("reservation", ReservationArgs.builder()
 *             .name("my-reservation")
 *             .location("us-west2")
 *             .slotCapacity(0)
 *             .edition("STANDARD")
 *             .ignoreIdleSlots(true)
 *             .concurrency(0)
 *             .autoscale(ReservationAutoscaleArgs.builder()
 *                 .maxSlots(100)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   reservation:
 *     type: gcp:bigquery:Reservation
 *     properties:
 *       name: my-reservation
 *       location: us-west2
 *       slotCapacity: 0
 *       edition: STANDARD
 *       ignoreIdleSlots: true
 *       concurrency: 0
 *       autoscale:
 *         maxSlots: 100
 * ```
 * 
 * ## Import
 * Reservation can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/reservations/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, Reservation can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:bigquery/reservation:Reservation default projects/{{project}}/locations/{{location}}/reservations/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigquery/reservation:Reservation default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigquery/reservation:Reservation default {{location}}/{{name}}
 * ```
 * @property autoscale The configuration parameters for the auto scaling feature.
 * Structure is documented below.
 * @property concurrency Maximum number of queries that are allowed to run concurrently in this reservation. This is a soft limit due to asynchronous nature of the system and various optimizations for small queries. Default value is 0 which means that concurrency will be automatically set based on the reservation size.
 * @property edition The edition type. Valid values are STANDARD, ENTERPRISE, ENTERPRISE_PLUS
 * @property ignoreIdleSlots If false, any query using this reservation will use idle slots from other reservations within
 * the same admin project. If true, a query using this reservation will execute with the slot
 * capacity specified above at most.
 * @property location The geographic location where the transfer config should reside.
 * Examples: US, EU, asia-northeast1. The default value is US.
 * @property name The name of the reservation. This field must only contain alphanumeric characters or dash.
 * - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property slotCapacity Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the
 * unit of parallelism. Queries using this reservation might use more slots during runtime if ignoreIdleSlots is set to false.
 */
public data class ReservationArgs(
    public val autoscale: Output? = null,
    public val concurrency: Output? = null,
    public val edition: Output? = null,
    public val ignoreIdleSlots: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val slotCapacity: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.bigquery.ReservationArgs =
        com.pulumi.gcp.bigquery.ReservationArgs.builder()
            .autoscale(autoscale?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .concurrency(concurrency?.applyValue({ args0 -> args0 }))
            .edition(edition?.applyValue({ args0 -> args0 }))
            .ignoreIdleSlots(ignoreIdleSlots?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .slotCapacity(slotCapacity?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ReservationArgs].
 */
@PulumiTagMarker
public class ReservationArgsBuilder internal constructor() {
    private var autoscale: Output? = null

    private var concurrency: Output? = null

    private var edition: Output? = null

    private var ignoreIdleSlots: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var slotCapacity: Output? = null

    /**
     * @param value The configuration parameters for the auto scaling feature.
     * Structure is documented below.
     */
    @JvmName("fkfhsgvuliedisja")
    public suspend fun autoscale(`value`: Output) {
        this.autoscale = value
    }

    /**
     * @param value Maximum number of queries that are allowed to run concurrently in this reservation. This is a soft limit due to asynchronous nature of the system and various optimizations for small queries. Default value is 0 which means that concurrency will be automatically set based on the reservation size.
     */
    @JvmName("trtmhutkgrdedfad")
    public suspend fun concurrency(`value`: Output) {
        this.concurrency = value
    }

    /**
     * @param value The edition type. Valid values are STANDARD, ENTERPRISE, ENTERPRISE_PLUS
     */
    @JvmName("tgiwuxjvhafalkft")
    public suspend fun edition(`value`: Output) {
        this.edition = value
    }

    /**
     * @param value If false, any query using this reservation will use idle slots from other reservations within
     * the same admin project. If true, a query using this reservation will execute with the slot
     * capacity specified above at most.
     */
    @JvmName("tvhtyqlksihpapbr")
    public suspend fun ignoreIdleSlots(`value`: Output) {
        this.ignoreIdleSlots = value
    }

    /**
     * @param value The geographic location where the transfer config should reside.
     * Examples: US, EU, asia-northeast1. The default value is US.
     */
    @JvmName("mrjmqjvxymlhloxg")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name of the reservation. This field must only contain alphanumeric characters or dash.
     * - - -
     */
    @JvmName("dahwmnhxqnnppyxx")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("qilhavmrldbodrni")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the
     * unit of parallelism. Queries using this reservation might use more slots during runtime if ignoreIdleSlots is set to false.
     */
    @JvmName("mogfpgsdqrdjbqqm")
    public suspend fun slotCapacity(`value`: Output) {
        this.slotCapacity = value
    }

    /**
     * @param value The configuration parameters for the auto scaling feature.
     * Structure is documented below.
     */
    @JvmName("dkyaxcxehjxevslc")
    public suspend fun autoscale(`value`: ReservationAutoscaleArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoscale = mapped
    }

    /**
     * @param argument The configuration parameters for the auto scaling feature.
     * Structure is documented below.
     */
    @JvmName("tujgqumgurdshxvt")
    public suspend fun autoscale(argument: suspend ReservationAutoscaleArgsBuilder.() -> Unit) {
        val toBeMapped = ReservationAutoscaleArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.autoscale = mapped
    }

    /**
     * @param value Maximum number of queries that are allowed to run concurrently in this reservation. This is a soft limit due to asynchronous nature of the system and various optimizations for small queries. Default value is 0 which means that concurrency will be automatically set based on the reservation size.
     */
    @JvmName("wovepjweknlwwdye")
    public suspend fun concurrency(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.concurrency = mapped
    }

    /**
     * @param value The edition type. Valid values are STANDARD, ENTERPRISE, ENTERPRISE_PLUS
     */
    @JvmName("txresxlxsskbfnjb")
    public suspend fun edition(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.edition = mapped
    }

    /**
     * @param value If false, any query using this reservation will use idle slots from other reservations within
     * the same admin project. If true, a query using this reservation will execute with the slot
     * capacity specified above at most.
     */
    @JvmName("lxgfyggwoouajmpa")
    public suspend fun ignoreIdleSlots(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ignoreIdleSlots = mapped
    }

    /**
     * @param value The geographic location where the transfer config should reside.
     * Examples: US, EU, asia-northeast1. The default value is US.
     */
    @JvmName("qfbnsvvsxuhollhd")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name of the reservation. This field must only contain alphanumeric characters or dash.
     * - - -
     */
    @JvmName("yejogbndieebyfdi")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("haqrjdehhudijmht")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the
     * unit of parallelism. Queries using this reservation might use more slots during runtime if ignoreIdleSlots is set to false.
     */
    @JvmName("ayyjbndimbjhtxxp")
    public suspend fun slotCapacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.slotCapacity = mapped
    }

    internal fun build(): ReservationArgs = ReservationArgs(
        autoscale = autoscale,
        concurrency = concurrency,
        edition = edition,
        ignoreIdleSlots = ignoreIdleSlots,
        location = location,
        name = name,
        project = project,
        slotCapacity = slotCapacity,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy