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

com.pulumi.gcp.pubsub.kotlin.LiteReservationArgs.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.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.pubsub.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.pubsub.LiteReservationArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * A named resource representing a shared pool of capacity.
 * To get more information about Reservation, see:
 * * [API documentation](https://cloud.google.com/pubsub/lite/docs/reference/rest/v1/admin.projects.locations.reservations)
 * * How-to Guides
 *     * [Managing Reservations](https://cloud.google.com/pubsub/lite/docs/reservations)
 * ## Example Usage
 * ### Pubsub Lite Reservation Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = gcp.organizations.getProject({});
 * const example = new gcp.pubsub.LiteReservation("example", {
 *     name: "example-reservation",
 *     project: project.then(project => project.number),
 *     throughputCapacity: 2,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.organizations.get_project()
 * example = gcp.pubsub.LiteReservation("example",
 *     name="example-reservation",
 *     project=project.number,
 *     throughput_capacity=2)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var example = new Gcp.PubSub.LiteReservation("example", new()
 *     {
 *         Name = "example-reservation",
 *         Project = project.Apply(getProjectResult => getProjectResult.Number),
 *         ThroughputCapacity = 2,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewLiteReservation(ctx, "example", &pubsub.LiteReservationArgs{
 * 			Name:               pulumi.String("example-reservation"),
 * 			Project:            pulumi.String(project.Number),
 * 			ThroughputCapacity: pulumi.Int(2),
 * 		})
 * 		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.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.pubsub.LiteReservation;
 * import com.pulumi.gcp.pubsub.LiteReservationArgs;
 * 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 project = OrganizationsFunctions.getProject();
 *         var example = new LiteReservation("example", LiteReservationArgs.builder()
 *             .name("example-reservation")
 *             .project(project.applyValue(getProjectResult -> getProjectResult.number()))
 *             .throughputCapacity(2)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:LiteReservation
 *     properties:
 *       name: example-reservation
 *       project: ${project.number}
 *       throughputCapacity: 2
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Reservation can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{region}}/reservations/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Reservation can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:pubsub/liteReservation:LiteReservation default projects/{{project}}/locations/{{region}}/reservations/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{name}}
 * ```
 * @property name Name of the reservation.
 * - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property region The region of the pubsub lite reservation.
 * @property throughputCapacity The reserved throughput capacity. Every unit of throughput capacity is
 * equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed
 * messages.
 */
public data class LiteReservationArgs(
    public val name: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
    public val throughputCapacity: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.pubsub.LiteReservationArgs =
        com.pulumi.gcp.pubsub.LiteReservationArgs.builder()
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .throughputCapacity(throughputCapacity?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LiteReservationArgs].
 */
@PulumiTagMarker
public class LiteReservationArgsBuilder internal constructor() {
    private var name: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    private var throughputCapacity: Output? = null

    /**
     * @param value Name of the reservation.
     * - - -
     */
    @JvmName("hwfynkfdsbwwrhef")
    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("xhsykytmfnqlngop")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The region of the pubsub lite reservation.
     */
    @JvmName("ukjadhkfepjhmncp")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value The reserved throughput capacity. Every unit of throughput capacity is
     * equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed
     * messages.
     */
    @JvmName("bxttxahcdsvimapq")
    public suspend fun throughputCapacity(`value`: Output) {
        this.throughputCapacity = value
    }

    /**
     * @param value Name of the reservation.
     * - - -
     */
    @JvmName("mnaqiyvnyuweurmu")
    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("ayrulqjlpfdawuug")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The region of the pubsub lite reservation.
     */
    @JvmName("mrsejefdnvflwtbp")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value The reserved throughput capacity. Every unit of throughput capacity is
     * equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed
     * messages.
     */
    @JvmName("pmiebruxwwjnvclj")
    public suspend fun throughputCapacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.throughputCapacity = mapped
    }

    internal fun build(): LiteReservationArgs = LiteReservationArgs(
        name = name,
        project = project,
        region = region,
        throughputCapacity = throughputCapacity,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy