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

com.pulumi.gcp.cloudtasks.kotlin.QueueArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.cloudtasks.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudtasks.QueueArgs.builder
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueAppEngineRoutingOverrideArgs
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueAppEngineRoutingOverrideArgsBuilder
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueRateLimitsArgs
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueRateLimitsArgsBuilder
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueRetryConfigArgs
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueRetryConfigArgsBuilder
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueStackdriverLoggingConfigArgs
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueStackdriverLoggingConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * A named resource to which messages are sent by publishers.
 * ## Example Usage
 * ### Queue Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.cloudtasks.Queue("default", {
 *     name: "cloud-tasks-queue-test",
 *     location: "us-central1",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.cloudtasks.Queue("default",
 *     name="cloud-tasks-queue-test",
 *     location="us-central1")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.CloudTasks.Queue("default", new()
 *     {
 *         Name = "cloud-tasks-queue-test",
 *         Location = "us-central1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudtasks"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudtasks.NewQueue(ctx, "default", &cloudtasks.QueueArgs{
 * 			Name:     pulumi.String("cloud-tasks-queue-test"),
 * 			Location: pulumi.String("us-central1"),
 * 		})
 * 		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.cloudtasks.Queue;
 * import com.pulumi.gcp.cloudtasks.QueueArgs;
 * 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 default_ = new Queue("default", QueueArgs.builder()
 *             .name("cloud-tasks-queue-test")
 *             .location("us-central1")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:cloudtasks:Queue
 *     properties:
 *       name: cloud-tasks-queue-test
 *       location: us-central1
 * ```
 * 
 * ### Cloud Tasks Queue Advanced
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const advancedConfiguration = new gcp.cloudtasks.Queue("advanced_configuration", {
 *     name: "instance-name",
 *     location: "us-central1",
 *     appEngineRoutingOverride: {
 *         service: "worker",
 *         version: "1.0",
 *         instance: "test",
 *     },
 *     rateLimits: {
 *         maxConcurrentDispatches: 3,
 *         maxDispatchesPerSecond: 2,
 *     },
 *     retryConfig: {
 *         maxAttempts: 5,
 *         maxRetryDuration: "4s",
 *         maxBackoff: "3s",
 *         minBackoff: "2s",
 *         maxDoublings: 1,
 *     },
 *     stackdriverLoggingConfig: {
 *         samplingRatio: 0.9,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * advanced_configuration = gcp.cloudtasks.Queue("advanced_configuration",
 *     name="instance-name",
 *     location="us-central1",
 *     app_engine_routing_override={
 *         "service": "worker",
 *         "version": "1.0",
 *         "instance": "test",
 *     },
 *     rate_limits={
 *         "max_concurrent_dispatches": 3,
 *         "max_dispatches_per_second": 2,
 *     },
 *     retry_config={
 *         "max_attempts": 5,
 *         "max_retry_duration": "4s",
 *         "max_backoff": "3s",
 *         "min_backoff": "2s",
 *         "max_doublings": 1,
 *     },
 *     stackdriver_logging_config={
 *         "sampling_ratio": 0.9,
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var advancedConfiguration = new Gcp.CloudTasks.Queue("advanced_configuration", new()
 *     {
 *         Name = "instance-name",
 *         Location = "us-central1",
 *         AppEngineRoutingOverride = new Gcp.CloudTasks.Inputs.QueueAppEngineRoutingOverrideArgs
 *         {
 *             Service = "worker",
 *             Version = "1.0",
 *             Instance = "test",
 *         },
 *         RateLimits = new Gcp.CloudTasks.Inputs.QueueRateLimitsArgs
 *         {
 *             MaxConcurrentDispatches = 3,
 *             MaxDispatchesPerSecond = 2,
 *         },
 *         RetryConfig = new Gcp.CloudTasks.Inputs.QueueRetryConfigArgs
 *         {
 *             MaxAttempts = 5,
 *             MaxRetryDuration = "4s",
 *             MaxBackoff = "3s",
 *             MinBackoff = "2s",
 *             MaxDoublings = 1,
 *         },
 *         StackdriverLoggingConfig = new Gcp.CloudTasks.Inputs.QueueStackdriverLoggingConfigArgs
 *         {
 *             SamplingRatio = 0.9,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudtasks"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudtasks.NewQueue(ctx, "advanced_configuration", &cloudtasks.QueueArgs{
 * 			Name:     pulumi.String("instance-name"),
 * 			Location: pulumi.String("us-central1"),
 * 			AppEngineRoutingOverride: &cloudtasks.QueueAppEngineRoutingOverrideArgs{
 * 				Service:  pulumi.String("worker"),
 * 				Version:  pulumi.String("1.0"),
 * 				Instance: pulumi.String("test"),
 * 			},
 * 			RateLimits: &cloudtasks.QueueRateLimitsArgs{
 * 				MaxConcurrentDispatches: pulumi.Int(3),
 * 				MaxDispatchesPerSecond:  pulumi.Float64(2),
 * 			},
 * 			RetryConfig: &cloudtasks.QueueRetryConfigArgs{
 * 				MaxAttempts:      pulumi.Int(5),
 * 				MaxRetryDuration: pulumi.String("4s"),
 * 				MaxBackoff:       pulumi.String("3s"),
 * 				MinBackoff:       pulumi.String("2s"),
 * 				MaxDoublings:     pulumi.Int(1),
 * 			},
 * 			StackdriverLoggingConfig: &cloudtasks.QueueStackdriverLoggingConfigArgs{
 * 				SamplingRatio: pulumi.Float64(0.9),
 * 			},
 * 		})
 * 		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.cloudtasks.Queue;
 * import com.pulumi.gcp.cloudtasks.QueueArgs;
 * import com.pulumi.gcp.cloudtasks.inputs.QueueAppEngineRoutingOverrideArgs;
 * import com.pulumi.gcp.cloudtasks.inputs.QueueRateLimitsArgs;
 * import com.pulumi.gcp.cloudtasks.inputs.QueueRetryConfigArgs;
 * import com.pulumi.gcp.cloudtasks.inputs.QueueStackdriverLoggingConfigArgs;
 * 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 advancedConfiguration = new Queue("advancedConfiguration", QueueArgs.builder()
 *             .name("instance-name")
 *             .location("us-central1")
 *             .appEngineRoutingOverride(QueueAppEngineRoutingOverrideArgs.builder()
 *                 .service("worker")
 *                 .version("1.0")
 *                 .instance("test")
 *                 .build())
 *             .rateLimits(QueueRateLimitsArgs.builder()
 *                 .maxConcurrentDispatches(3)
 *                 .maxDispatchesPerSecond(2)
 *                 .build())
 *             .retryConfig(QueueRetryConfigArgs.builder()
 *                 .maxAttempts(5)
 *                 .maxRetryDuration("4s")
 *                 .maxBackoff("3s")
 *                 .minBackoff("2s")
 *                 .maxDoublings(1)
 *                 .build())
 *             .stackdriverLoggingConfig(QueueStackdriverLoggingConfigArgs.builder()
 *                 .samplingRatio(0.9)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   advancedConfiguration:
 *     type: gcp:cloudtasks:Queue
 *     name: advanced_configuration
 *     properties:
 *       name: instance-name
 *       location: us-central1
 *       appEngineRoutingOverride:
 *         service: worker
 *         version: '1.0'
 *         instance: test
 *       rateLimits:
 *         maxConcurrentDispatches: 3
 *         maxDispatchesPerSecond: 2
 *       retryConfig:
 *         maxAttempts: 5
 *         maxRetryDuration: 4s
 *         maxBackoff: 3s
 *         minBackoff: 2s
 *         maxDoublings: 1
 *       stackdriverLoggingConfig:
 *         samplingRatio: 0.9
 * ```
 * 
 * ## Import
 * Queue can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/queues/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, Queue can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:cloudtasks/queue:Queue default projects/{{project}}/locations/{{location}}/queues/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:cloudtasks/queue:Queue default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:cloudtasks/queue:Queue default {{location}}/{{name}}
 * ```
 * @property appEngineRoutingOverride Overrides for task-level appEngineRouting. These settings apply only
 * to App Engine tasks in this queue
 * Structure is documented below.
 * @property location The location of the queue
 * - - -
 * @property name The queue name.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property rateLimits Rate limits for task dispatches.
 * The queue's actual dispatch rate is the result of:
 * * Number of tasks in the queue
 * * User-specified throttling: rateLimits, retryConfig, and the queue's state.
 * * System throttling due to 429 (Too Many Requests) or 503 (Service
 * Unavailable) responses from the worker, high error rates, or to
 * smooth sudden large traffic spikes.
 * Structure is documented below.
 * @property retryConfig Settings that determine the retry behavior.
 * Structure is documented below.
 * @property stackdriverLoggingConfig Configuration options for writing logs to Stackdriver Logging.
 * Structure is documented below.
 */
public data class QueueArgs(
    public val appEngineRoutingOverride: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val rateLimits: Output? = null,
    public val retryConfig: Output? = null,
    public val stackdriverLoggingConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudtasks.QueueArgs =
        com.pulumi.gcp.cloudtasks.QueueArgs.builder()
            .appEngineRoutingOverride(
                appEngineRoutingOverride?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .rateLimits(rateLimits?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .retryConfig(retryConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .stackdriverLoggingConfig(
                stackdriverLoggingConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [QueueArgs].
 */
@PulumiTagMarker
public class QueueArgsBuilder internal constructor() {
    private var appEngineRoutingOverride: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var rateLimits: Output? = null

    private var retryConfig: Output? = null

    private var stackdriverLoggingConfig: Output? = null

    /**
     * @param value Overrides for task-level appEngineRouting. These settings apply only
     * to App Engine tasks in this queue
     * Structure is documented below.
     */
    @JvmName("dinshbjpwtfbpqty")
    public suspend fun appEngineRoutingOverride(`value`: Output) {
        this.appEngineRoutingOverride = value
    }

    /**
     * @param value The location of the queue
     * - - -
     */
    @JvmName("lhgeukbbyswormbp")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The queue name.
     */
    @JvmName("ayedmhqegmreixym")
    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("mylufigbhfcsmvht")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Rate limits for task dispatches.
     * The queue's actual dispatch rate is the result of:
     * * Number of tasks in the queue
     * * User-specified throttling: rateLimits, retryConfig, and the queue's state.
     * * System throttling due to 429 (Too Many Requests) or 503 (Service
     * Unavailable) responses from the worker, high error rates, or to
     * smooth sudden large traffic spikes.
     * Structure is documented below.
     */
    @JvmName("tjtfqxarwdoqgkbs")
    public suspend fun rateLimits(`value`: Output) {
        this.rateLimits = value
    }

    /**
     * @param value Settings that determine the retry behavior.
     * Structure is documented below.
     */
    @JvmName("hohvldjoilxlnlrb")
    public suspend fun retryConfig(`value`: Output) {
        this.retryConfig = value
    }

    /**
     * @param value Configuration options for writing logs to Stackdriver Logging.
     * Structure is documented below.
     */
    @JvmName("bowkmccpbiwoonkm")
    public suspend fun stackdriverLoggingConfig(`value`: Output) {
        this.stackdriverLoggingConfig = value
    }

    /**
     * @param value Overrides for task-level appEngineRouting. These settings apply only
     * to App Engine tasks in this queue
     * Structure is documented below.
     */
    @JvmName("opsjtokojdxiwasf")
    public suspend fun appEngineRoutingOverride(`value`: QueueAppEngineRoutingOverrideArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.appEngineRoutingOverride = mapped
    }

    /**
     * @param argument Overrides for task-level appEngineRouting. These settings apply only
     * to App Engine tasks in this queue
     * Structure is documented below.
     */
    @JvmName("iskcwgttgntuyhyo")
    public suspend fun appEngineRoutingOverride(argument: suspend QueueAppEngineRoutingOverrideArgsBuilder.() -> Unit) {
        val toBeMapped = QueueAppEngineRoutingOverrideArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.appEngineRoutingOverride = mapped
    }

    /**
     * @param value The location of the queue
     * - - -
     */
    @JvmName("oibxpbwertmjonpp")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The queue name.
     */
    @JvmName("vupdjotrqnwcbkcc")
    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("hcgdpaqebmtctepd")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Rate limits for task dispatches.
     * The queue's actual dispatch rate is the result of:
     * * Number of tasks in the queue
     * * User-specified throttling: rateLimits, retryConfig, and the queue's state.
     * * System throttling due to 429 (Too Many Requests) or 503 (Service
     * Unavailable) responses from the worker, high error rates, or to
     * smooth sudden large traffic spikes.
     * Structure is documented below.
     */
    @JvmName("inmedkoissbudrqp")
    public suspend fun rateLimits(`value`: QueueRateLimitsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rateLimits = mapped
    }

    /**
     * @param argument Rate limits for task dispatches.
     * The queue's actual dispatch rate is the result of:
     * * Number of tasks in the queue
     * * User-specified throttling: rateLimits, retryConfig, and the queue's state.
     * * System throttling due to 429 (Too Many Requests) or 503 (Service
     * Unavailable) responses from the worker, high error rates, or to
     * smooth sudden large traffic spikes.
     * Structure is documented below.
     */
    @JvmName("fufbwadvctorfpqc")
    public suspend fun rateLimits(argument: suspend QueueRateLimitsArgsBuilder.() -> Unit) {
        val toBeMapped = QueueRateLimitsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.rateLimits = mapped
    }

    /**
     * @param value Settings that determine the retry behavior.
     * Structure is documented below.
     */
    @JvmName("ymcajbwagevsrudv")
    public suspend fun retryConfig(`value`: QueueRetryConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retryConfig = mapped
    }

    /**
     * @param argument Settings that determine the retry behavior.
     * Structure is documented below.
     */
    @JvmName("pigqkjldfceaksdt")
    public suspend fun retryConfig(argument: suspend QueueRetryConfigArgsBuilder.() -> Unit) {
        val toBeMapped = QueueRetryConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.retryConfig = mapped
    }

    /**
     * @param value Configuration options for writing logs to Stackdriver Logging.
     * Structure is documented below.
     */
    @JvmName("beybbrlgfqatoxay")
    public suspend fun stackdriverLoggingConfig(`value`: QueueStackdriverLoggingConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stackdriverLoggingConfig = mapped
    }

    /**
     * @param argument Configuration options for writing logs to Stackdriver Logging.
     * Structure is documented below.
     */
    @JvmName("hguesovawnjeggjq")
    public suspend fun stackdriverLoggingConfig(argument: suspend QueueStackdriverLoggingConfigArgsBuilder.() -> Unit) {
        val toBeMapped = QueueStackdriverLoggingConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.stackdriverLoggingConfig = mapped
    }

    internal fun build(): QueueArgs = QueueArgs(
        appEngineRoutingOverride = appEngineRoutingOverride,
        location = location,
        name = name,
        project = project,
        rateLimits = rateLimits,
        retryConfig = retryConfig,
        stackdriverLoggingConfig = stackdriverLoggingConfig,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy