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

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

@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.CapacityCommitmentArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Capacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes.
 * In order to remove annual commitment, its plan needs to be changed to monthly or flex first.
 * To get more information about CapacityCommitment, see:
 * * [API documentation](https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/projects.locations.capacityCommitments)
 * * How-to Guides
 *     * [Introduction to Reservations](https://cloud.google.com/bigquery/docs/reservations-intro)
 * ## Example Usage
 * ### Bigquery Reservation Capacity Commitment Docs
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.bigquery.CapacityCommitment("example", {
 *     capacityCommitmentId: "example-commitment",
 *     location: "us-west2",
 *     slotCount: 100,
 *     plan: "FLEX_FLAT_RATE",
 *     edition: "ENTERPRISE",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.bigquery.CapacityCommitment("example",
 *     capacity_commitment_id="example-commitment",
 *     location="us-west2",
 *     slot_count=100,
 *     plan="FLEX_FLAT_RATE",
 *     edition="ENTERPRISE")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.BigQuery.CapacityCommitment("example", new()
 *     {
 *         CapacityCommitmentId = "example-commitment",
 *         Location = "us-west2",
 *         SlotCount = 100,
 *         Plan = "FLEX_FLAT_RATE",
 *         Edition = "ENTERPRISE",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigquery"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := bigquery.NewCapacityCommitment(ctx, "example", &bigquery.CapacityCommitmentArgs{
 * 			CapacityCommitmentId: pulumi.String("example-commitment"),
 * 			Location:             pulumi.String("us-west2"),
 * 			SlotCount:            pulumi.Int(100),
 * 			Plan:                 pulumi.String("FLEX_FLAT_RATE"),
 * 			Edition:              pulumi.String("ENTERPRISE"),
 * 		})
 * 		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.CapacityCommitment;
 * import com.pulumi.gcp.bigquery.CapacityCommitmentArgs;
 * 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 example = new CapacityCommitment("example", CapacityCommitmentArgs.builder()
 *             .capacityCommitmentId("example-commitment")
 *             .location("us-west2")
 *             .slotCount(100)
 *             .plan("FLEX_FLAT_RATE")
 *             .edition("ENTERPRISE")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:bigquery:CapacityCommitment
 *     properties:
 *       capacityCommitmentId: example-commitment
 *       location: us-west2
 *       slotCount: 100
 *       plan: FLEX_FLAT_RATE
 *       edition: ENTERPRISE
 * ```
 * 
 * ## Import
 * CapacityCommitment can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}`
 * * `{{project}}/{{location}}/{{capacity_commitment_id}}`
 * * `{{location}}/{{capacity_commitment_id}}`
 * When using the `pulumi import` command, CapacityCommitment can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:bigquery/capacityCommitment:CapacityCommitment default projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigquery/capacityCommitment:CapacityCommitment default {{project}}/{{location}}/{{capacity_commitment_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigquery/capacityCommitment:CapacityCommitment default {{location}}/{{capacity_commitment_id}}
 * ```
 * @property capacityCommitmentId The optional capacity commitment ID. Capacity commitment name will be generated automatically if this field is
 * empty. This field must only contain lower case alphanumeric characters or dashes. The first and last character
 * cannot be a dash. Max length is 64 characters. NOTE: this ID won't be kept if the capacity commitment is split
 * or merged.
 * @property edition The edition type. Valid values are STANDARD, ENTERPRISE, ENTERPRISE_PLUS
 * @property enforceSingleAdminProjectPerOrg If true, fail the request if another project in the organization has a capacity commitment.
 * @property location The geographic location where the transfer config should reside.
 * Examples: US, EU, asia-northeast1. The default value is US.
 * @property plan Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan
 * - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property renewalPlan The plan this capacity commitment is converted to after commitmentEndTime passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for some commitment plans.
 * @property slotCount Number of slots in this commitment.
 */
public data class CapacityCommitmentArgs(
    public val capacityCommitmentId: Output? = null,
    public val edition: Output? = null,
    public val enforceSingleAdminProjectPerOrg: Output? = null,
    public val location: Output? = null,
    public val plan: Output? = null,
    public val project: Output? = null,
    public val renewalPlan: Output? = null,
    public val slotCount: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.bigquery.CapacityCommitmentArgs =
        com.pulumi.gcp.bigquery.CapacityCommitmentArgs.builder()
            .capacityCommitmentId(capacityCommitmentId?.applyValue({ args0 -> args0 }))
            .edition(edition?.applyValue({ args0 -> args0 }))
            .enforceSingleAdminProjectPerOrg(enforceSingleAdminProjectPerOrg?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .plan(plan?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .renewalPlan(renewalPlan?.applyValue({ args0 -> args0 }))
            .slotCount(slotCount?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [CapacityCommitmentArgs].
 */
@PulumiTagMarker
public class CapacityCommitmentArgsBuilder internal constructor() {
    private var capacityCommitmentId: Output? = null

    private var edition: Output? = null

    private var enforceSingleAdminProjectPerOrg: Output? = null

    private var location: Output? = null

    private var plan: Output? = null

    private var project: Output? = null

    private var renewalPlan: Output? = null

    private var slotCount: Output? = null

    /**
     * @param value The optional capacity commitment ID. Capacity commitment name will be generated automatically if this field is
     * empty. This field must only contain lower case alphanumeric characters or dashes. The first and last character
     * cannot be a dash. Max length is 64 characters. NOTE: this ID won't be kept if the capacity commitment is split
     * or merged.
     */
    @JvmName("pwfkkoktpdclajno")
    public suspend fun capacityCommitmentId(`value`: Output) {
        this.capacityCommitmentId = value
    }

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

    /**
     * @param value If true, fail the request if another project in the organization has a capacity commitment.
     */
    @JvmName("fjuaagwvbnuypcfo")
    public suspend fun enforceSingleAdminProjectPerOrg(`value`: Output) {
        this.enforceSingleAdminProjectPerOrg = value
    }

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

    /**
     * @param value Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan
     * - - -
     */
    @JvmName("kojwiyavffsuxdxl")
    public suspend fun plan(`value`: Output) {
        this.plan = value
    }

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

    /**
     * @param value The plan this capacity commitment is converted to after commitmentEndTime passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for some commitment plans.
     */
    @JvmName("jhhhydqtkdanbwua")
    public suspend fun renewalPlan(`value`: Output) {
        this.renewalPlan = value
    }

    /**
     * @param value Number of slots in this commitment.
     */
    @JvmName("digmlbacvuhaxxjn")
    public suspend fun slotCount(`value`: Output) {
        this.slotCount = value
    }

    /**
     * @param value The optional capacity commitment ID. Capacity commitment name will be generated automatically if this field is
     * empty. This field must only contain lower case alphanumeric characters or dashes. The first and last character
     * cannot be a dash. Max length is 64 characters. NOTE: this ID won't be kept if the capacity commitment is split
     * or merged.
     */
    @JvmName("nqjvromallfvslhc")
    public suspend fun capacityCommitmentId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacityCommitmentId = mapped
    }

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

    /**
     * @param value If true, fail the request if another project in the organization has a capacity commitment.
     */
    @JvmName("dwapekpnlubnofhv")
    public suspend fun enforceSingleAdminProjectPerOrg(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enforceSingleAdminProjectPerOrg = mapped
    }

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

    /**
     * @param value Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan
     * - - -
     */
    @JvmName("kgrqjlnopuvbkdqy")
    public suspend fun plan(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.plan = mapped
    }

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

    /**
     * @param value The plan this capacity commitment is converted to after commitmentEndTime passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for some commitment plans.
     */
    @JvmName("uydrwpvlgvrjblbu")
    public suspend fun renewalPlan(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.renewalPlan = mapped
    }

    /**
     * @param value Number of slots in this commitment.
     */
    @JvmName("ndhesnpavlufnarf")
    public suspend fun slotCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.slotCount = mapped
    }

    internal fun build(): CapacityCommitmentArgs = CapacityCommitmentArgs(
        capacityCommitmentId = capacityCommitmentId,
        edition = edition,
        enforceSingleAdminProjectPerOrg = enforceSingleAdminProjectPerOrg,
        location = location,
        plan = plan,
        project = project,
        renewalPlan = renewalPlan,
        slotCount = slotCount,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy