com.pulumi.gcp.cloudtasks.kotlin.QueueArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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.QueueHttpTargetArgs
import com.pulumi.gcp.cloudtasks.kotlin.inputs.QueueHttpTargetArgsBuilder
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/v8/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/v8/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
* ```
*
* ### Cloud Tasks Queue Http Target Oidc
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const oidcServiceAccount = new gcp.serviceaccount.Account("oidc_service_account", {
* accountId: "example-oidc",
* displayName: "Tasks Queue OIDC Service Account",
* });
* const httpTargetOidc = new gcp.cloudtasks.Queue("http_target_oidc", {
* name: "cloud-tasks-queue-http-target-oidc",
* location: "us-central1",
* httpTarget: {
* httpMethod: "POST",
* uriOverride: {
* scheme: "HTTPS",
* host: "oidc.example.com",
* port: "8443",
* pathOverride: {
* path: "/users/1234",
* },
* queryOverride: {
* queryParams: "qparam1=123&qparam2=456",
* },
* uriOverrideEnforceMode: "IF_NOT_EXISTS",
* },
* headerOverrides: [
* {
* header: {
* key: "AddSomethingElse",
* value: "MyOtherValue",
* },
* },
* {
* header: {
* key: "AddMe",
* value: "MyValue",
* },
* },
* ],
* oidcToken: {
* serviceAccountEmail: oidcServiceAccount.email,
* audience: "https://oidc.example.com",
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* oidc_service_account = gcp.serviceaccount.Account("oidc_service_account",
* account_id="example-oidc",
* display_name="Tasks Queue OIDC Service Account")
* http_target_oidc = gcp.cloudtasks.Queue("http_target_oidc",
* name="cloud-tasks-queue-http-target-oidc",
* location="us-central1",
* http_target={
* "http_method": "POST",
* "uri_override": {
* "scheme": "HTTPS",
* "host": "oidc.example.com",
* "port": "8443",
* "path_override": {
* "path": "/users/1234",
* },
* "query_override": {
* "query_params": "qparam1=123&qparam2=456",
* },
* "uri_override_enforce_mode": "IF_NOT_EXISTS",
* },
* "header_overrides": [
* {
* "header": {
* "key": "AddSomethingElse",
* "value": "MyOtherValue",
* },
* },
* {
* "header": {
* "key": "AddMe",
* "value": "MyValue",
* },
* },
* ],
* "oidc_token": {
* "service_account_email": oidc_service_account.email,
* "audience": "https://oidc.example.com",
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var oidcServiceAccount = new Gcp.ServiceAccount.Account("oidc_service_account", new()
* {
* AccountId = "example-oidc",
* DisplayName = "Tasks Queue OIDC Service Account",
* });
* var httpTargetOidc = new Gcp.CloudTasks.Queue("http_target_oidc", new()
* {
* Name = "cloud-tasks-queue-http-target-oidc",
* Location = "us-central1",
* HttpTarget = new Gcp.CloudTasks.Inputs.QueueHttpTargetArgs
* {
* HttpMethod = "POST",
* UriOverride = new Gcp.CloudTasks.Inputs.QueueHttpTargetUriOverrideArgs
* {
* Scheme = "HTTPS",
* Host = "oidc.example.com",
* Port = "8443",
* PathOverride = new Gcp.CloudTasks.Inputs.QueueHttpTargetUriOverridePathOverrideArgs
* {
* Path = "/users/1234",
* },
* QueryOverride = new Gcp.CloudTasks.Inputs.QueueHttpTargetUriOverrideQueryOverrideArgs
* {
* QueryParams = "qparam1=123&qparam2=456",
* },
* UriOverrideEnforceMode = "IF_NOT_EXISTS",
* },
* HeaderOverrides = new[]
* {
* new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideArgs
* {
* Header = new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideHeaderArgs
* {
* Key = "AddSomethingElse",
* Value = "MyOtherValue",
* },
* },
* new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideArgs
* {
* Header = new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideHeaderArgs
* {
* Key = "AddMe",
* Value = "MyValue",
* },
* },
* },
* OidcToken = new Gcp.CloudTasks.Inputs.QueueHttpTargetOidcTokenArgs
* {
* ServiceAccountEmail = oidcServiceAccount.Email,
* Audience = "https://oidc.example.com",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudtasks"
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceaccount"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* oidcServiceAccount, err := serviceaccount.NewAccount(ctx, "oidc_service_account", &serviceaccount.AccountArgs{
* AccountId: pulumi.String("example-oidc"),
* DisplayName: pulumi.String("Tasks Queue OIDC Service Account"),
* })
* if err != nil {
* return err
* }
* _, err = cloudtasks.NewQueue(ctx, "http_target_oidc", &cloudtasks.QueueArgs{
* Name: pulumi.String("cloud-tasks-queue-http-target-oidc"),
* Location: pulumi.String("us-central1"),
* HttpTarget: &cloudtasks.QueueHttpTargetArgs{
* HttpMethod: pulumi.String("POST"),
* UriOverride: &cloudtasks.QueueHttpTargetUriOverrideArgs{
* Scheme: pulumi.String("HTTPS"),
* Host: pulumi.String("oidc.example.com"),
* Port: pulumi.String("8443"),
* PathOverride: &cloudtasks.QueueHttpTargetUriOverridePathOverrideArgs{
* Path: pulumi.String("/users/1234"),
* },
* QueryOverride: &cloudtasks.QueueHttpTargetUriOverrideQueryOverrideArgs{
* QueryParams: pulumi.String("qparam1=123&qparam2=456"),
* },
* UriOverrideEnforceMode: pulumi.String("IF_NOT_EXISTS"),
* },
* HeaderOverrides: cloudtasks.QueueHttpTargetHeaderOverrideArray{
* &cloudtasks.QueueHttpTargetHeaderOverrideArgs{
* Header: &cloudtasks.QueueHttpTargetHeaderOverrideHeaderArgs{
* Key: pulumi.String("AddSomethingElse"),
* Value: pulumi.String("MyOtherValue"),
* },
* },
* &cloudtasks.QueueHttpTargetHeaderOverrideArgs{
* Header: &cloudtasks.QueueHttpTargetHeaderOverrideHeaderArgs{
* Key: pulumi.String("AddMe"),
* Value: pulumi.String("MyValue"),
* },
* },
* },
* OidcToken: &cloudtasks.QueueHttpTargetOidcTokenArgs{
* ServiceAccountEmail: oidcServiceAccount.Email,
* Audience: pulumi.String("https://oidc.example.com"),
* },
* },
* })
* 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.serviceaccount.Account;
* import com.pulumi.gcp.serviceaccount.AccountArgs;
* import com.pulumi.gcp.cloudtasks.Queue;
* import com.pulumi.gcp.cloudtasks.QueueArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetUriOverrideArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetUriOverridePathOverrideArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetUriOverrideQueryOverrideArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetOidcTokenArgs;
* 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 oidcServiceAccount = new Account("oidcServiceAccount", AccountArgs.builder()
* .accountId("example-oidc")
* .displayName("Tasks Queue OIDC Service Account")
* .build());
* var httpTargetOidc = new Queue("httpTargetOidc", QueueArgs.builder()
* .name("cloud-tasks-queue-http-target-oidc")
* .location("us-central1")
* .httpTarget(QueueHttpTargetArgs.builder()
* .httpMethod("POST")
* .uriOverride(QueueHttpTargetUriOverrideArgs.builder()
* .scheme("HTTPS")
* .host("oidc.example.com")
* .port(8443)
* .pathOverride(QueueHttpTargetUriOverridePathOverrideArgs.builder()
* .path("/users/1234")
* .build())
* .queryOverride(QueueHttpTargetUriOverrideQueryOverrideArgs.builder()
* .queryParams("qparam1=123&qparam2=456")
* .build())
* .uriOverrideEnforceMode("IF_NOT_EXISTS")
* .build())
* .headerOverrides(
* QueueHttpTargetHeaderOverrideArgs.builder()
* .header(QueueHttpTargetHeaderOverrideHeaderArgs.builder()
* .key("AddSomethingElse")
* .value("MyOtherValue")
* .build())
* .build(),
* QueueHttpTargetHeaderOverrideArgs.builder()
* .header(QueueHttpTargetHeaderOverrideHeaderArgs.builder()
* .key("AddMe")
* .value("MyValue")
* .build())
* .build())
* .oidcToken(QueueHttpTargetOidcTokenArgs.builder()
* .serviceAccountEmail(oidcServiceAccount.email())
* .audience("https://oidc.example.com")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* httpTargetOidc:
* type: gcp:cloudtasks:Queue
* name: http_target_oidc
* properties:
* name: cloud-tasks-queue-http-target-oidc
* location: us-central1
* httpTarget:
* httpMethod: POST
* uriOverride:
* scheme: HTTPS
* host: oidc.example.com
* port: 8443
* pathOverride:
* path: /users/1234
* queryOverride:
* queryParams: qparam1=123&qparam2=456
* uriOverrideEnforceMode: IF_NOT_EXISTS
* headerOverrides:
* - header:
* key: AddSomethingElse
* value: MyOtherValue
* - header:
* key: AddMe
* value: MyValue
* oidcToken:
* serviceAccountEmail: ${oidcServiceAccount.email}
* audience: https://oidc.example.com
* oidcServiceAccount:
* type: gcp:serviceaccount:Account
* name: oidc_service_account
* properties:
* accountId: example-oidc
* displayName: Tasks Queue OIDC Service Account
* ```
*
* ### Cloud Tasks Queue Http Target Oauth
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const oauthServiceAccount = new gcp.serviceaccount.Account("oauth_service_account", {
* accountId: "example-oauth",
* displayName: "Tasks Queue OAuth Service Account",
* });
* const httpTargetOauth = new gcp.cloudtasks.Queue("http_target_oauth", {
* name: "cloud-tasks-queue-http-target-oauth",
* location: "us-central1",
* httpTarget: {
* httpMethod: "POST",
* uriOverride: {
* scheme: "HTTPS",
* host: "oauth.example.com",
* port: "8443",
* pathOverride: {
* path: "/users/1234",
* },
* queryOverride: {
* queryParams: "qparam1=123&qparam2=456",
* },
* uriOverrideEnforceMode: "IF_NOT_EXISTS",
* },
* headerOverrides: [
* {
* header: {
* key: "AddSomethingElse",
* value: "MyOtherValue",
* },
* },
* {
* header: {
* key: "AddMe",
* value: "MyValue",
* },
* },
* ],
* oauthToken: {
* serviceAccountEmail: oauthServiceAccount.email,
* scope: "openid https://www.googleapis.com/auth/userinfo.email",
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* oauth_service_account = gcp.serviceaccount.Account("oauth_service_account",
* account_id="example-oauth",
* display_name="Tasks Queue OAuth Service Account")
* http_target_oauth = gcp.cloudtasks.Queue("http_target_oauth",
* name="cloud-tasks-queue-http-target-oauth",
* location="us-central1",
* http_target={
* "http_method": "POST",
* "uri_override": {
* "scheme": "HTTPS",
* "host": "oauth.example.com",
* "port": "8443",
* "path_override": {
* "path": "/users/1234",
* },
* "query_override": {
* "query_params": "qparam1=123&qparam2=456",
* },
* "uri_override_enforce_mode": "IF_NOT_EXISTS",
* },
* "header_overrides": [
* {
* "header": {
* "key": "AddSomethingElse",
* "value": "MyOtherValue",
* },
* },
* {
* "header": {
* "key": "AddMe",
* "value": "MyValue",
* },
* },
* ],
* "oauth_token": {
* "service_account_email": oauth_service_account.email,
* "scope": "openid https://www.googleapis.com/auth/userinfo.email",
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var oauthServiceAccount = new Gcp.ServiceAccount.Account("oauth_service_account", new()
* {
* AccountId = "example-oauth",
* DisplayName = "Tasks Queue OAuth Service Account",
* });
* var httpTargetOauth = new Gcp.CloudTasks.Queue("http_target_oauth", new()
* {
* Name = "cloud-tasks-queue-http-target-oauth",
* Location = "us-central1",
* HttpTarget = new Gcp.CloudTasks.Inputs.QueueHttpTargetArgs
* {
* HttpMethod = "POST",
* UriOverride = new Gcp.CloudTasks.Inputs.QueueHttpTargetUriOverrideArgs
* {
* Scheme = "HTTPS",
* Host = "oauth.example.com",
* Port = "8443",
* PathOverride = new Gcp.CloudTasks.Inputs.QueueHttpTargetUriOverridePathOverrideArgs
* {
* Path = "/users/1234",
* },
* QueryOverride = new Gcp.CloudTasks.Inputs.QueueHttpTargetUriOverrideQueryOverrideArgs
* {
* QueryParams = "qparam1=123&qparam2=456",
* },
* UriOverrideEnforceMode = "IF_NOT_EXISTS",
* },
* HeaderOverrides = new[]
* {
* new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideArgs
* {
* Header = new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideHeaderArgs
* {
* Key = "AddSomethingElse",
* Value = "MyOtherValue",
* },
* },
* new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideArgs
* {
* Header = new Gcp.CloudTasks.Inputs.QueueHttpTargetHeaderOverrideHeaderArgs
* {
* Key = "AddMe",
* Value = "MyValue",
* },
* },
* },
* OauthToken = new Gcp.CloudTasks.Inputs.QueueHttpTargetOauthTokenArgs
* {
* ServiceAccountEmail = oauthServiceAccount.Email,
* Scope = "openid https://www.googleapis.com/auth/userinfo.email",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudtasks"
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceaccount"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* oauthServiceAccount, err := serviceaccount.NewAccount(ctx, "oauth_service_account", &serviceaccount.AccountArgs{
* AccountId: pulumi.String("example-oauth"),
* DisplayName: pulumi.String("Tasks Queue OAuth Service Account"),
* })
* if err != nil {
* return err
* }
* _, err = cloudtasks.NewQueue(ctx, "http_target_oauth", &cloudtasks.QueueArgs{
* Name: pulumi.String("cloud-tasks-queue-http-target-oauth"),
* Location: pulumi.String("us-central1"),
* HttpTarget: &cloudtasks.QueueHttpTargetArgs{
* HttpMethod: pulumi.String("POST"),
* UriOverride: &cloudtasks.QueueHttpTargetUriOverrideArgs{
* Scheme: pulumi.String("HTTPS"),
* Host: pulumi.String("oauth.example.com"),
* Port: pulumi.String("8443"),
* PathOverride: &cloudtasks.QueueHttpTargetUriOverridePathOverrideArgs{
* Path: pulumi.String("/users/1234"),
* },
* QueryOverride: &cloudtasks.QueueHttpTargetUriOverrideQueryOverrideArgs{
* QueryParams: pulumi.String("qparam1=123&qparam2=456"),
* },
* UriOverrideEnforceMode: pulumi.String("IF_NOT_EXISTS"),
* },
* HeaderOverrides: cloudtasks.QueueHttpTargetHeaderOverrideArray{
* &cloudtasks.QueueHttpTargetHeaderOverrideArgs{
* Header: &cloudtasks.QueueHttpTargetHeaderOverrideHeaderArgs{
* Key: pulumi.String("AddSomethingElse"),
* Value: pulumi.String("MyOtherValue"),
* },
* },
* &cloudtasks.QueueHttpTargetHeaderOverrideArgs{
* Header: &cloudtasks.QueueHttpTargetHeaderOverrideHeaderArgs{
* Key: pulumi.String("AddMe"),
* Value: pulumi.String("MyValue"),
* },
* },
* },
* OauthToken: &cloudtasks.QueueHttpTargetOauthTokenArgs{
* ServiceAccountEmail: oauthServiceAccount.Email,
* Scope: pulumi.String("openid https://www.googleapis.com/auth/userinfo.email"),
* },
* },
* })
* 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.serviceaccount.Account;
* import com.pulumi.gcp.serviceaccount.AccountArgs;
* import com.pulumi.gcp.cloudtasks.Queue;
* import com.pulumi.gcp.cloudtasks.QueueArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetUriOverrideArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetUriOverridePathOverrideArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetUriOverrideQueryOverrideArgs;
* import com.pulumi.gcp.cloudtasks.inputs.QueueHttpTargetOauthTokenArgs;
* 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 oauthServiceAccount = new Account("oauthServiceAccount", AccountArgs.builder()
* .accountId("example-oauth")
* .displayName("Tasks Queue OAuth Service Account")
* .build());
* var httpTargetOauth = new Queue("httpTargetOauth", QueueArgs.builder()
* .name("cloud-tasks-queue-http-target-oauth")
* .location("us-central1")
* .httpTarget(QueueHttpTargetArgs.builder()
* .httpMethod("POST")
* .uriOverride(QueueHttpTargetUriOverrideArgs.builder()
* .scheme("HTTPS")
* .host("oauth.example.com")
* .port(8443)
* .pathOverride(QueueHttpTargetUriOverridePathOverrideArgs.builder()
* .path("/users/1234")
* .build())
* .queryOverride(QueueHttpTargetUriOverrideQueryOverrideArgs.builder()
* .queryParams("qparam1=123&qparam2=456")
* .build())
* .uriOverrideEnforceMode("IF_NOT_EXISTS")
* .build())
* .headerOverrides(
* QueueHttpTargetHeaderOverrideArgs.builder()
* .header(QueueHttpTargetHeaderOverrideHeaderArgs.builder()
* .key("AddSomethingElse")
* .value("MyOtherValue")
* .build())
* .build(),
* QueueHttpTargetHeaderOverrideArgs.builder()
* .header(QueueHttpTargetHeaderOverrideHeaderArgs.builder()
* .key("AddMe")
* .value("MyValue")
* .build())
* .build())
* .oauthToken(QueueHttpTargetOauthTokenArgs.builder()
* .serviceAccountEmail(oauthServiceAccount.email())
* .scope("openid https://www.googleapis.com/auth/userinfo.email")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* httpTargetOauth:
* type: gcp:cloudtasks:Queue
* name: http_target_oauth
* properties:
* name: cloud-tasks-queue-http-target-oauth
* location: us-central1
* httpTarget:
* httpMethod: POST
* uriOverride:
* scheme: HTTPS
* host: oauth.example.com
* port: 8443
* pathOverride:
* path: /users/1234
* queryOverride:
* queryParams: qparam1=123&qparam2=456
* uriOverrideEnforceMode: IF_NOT_EXISTS
* headerOverrides:
* - header:
* key: AddSomethingElse
* value: MyOtherValue
* - header:
* key: AddMe
* value: MyValue
* oauthToken:
* serviceAccountEmail: ${oauthServiceAccount.email}
* scope: openid https://www.googleapis.com/auth/userinfo.email
* oauthServiceAccount:
* type: gcp:serviceaccount:Account
* name: oauth_service_account
* properties:
* accountId: example-oauth
* displayName: Tasks Queue OAuth Service Account
* ```
*
* ## 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 httpTarget Modifies HTTP target for HTTP tasks.
* 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 httpTarget: 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()
})
}),
)
.httpTarget(httpTarget?.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 httpTarget: 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("uduyxbtlwqixrjsq")
public suspend fun appEngineRoutingOverride(`value`: Output) {
this.appEngineRoutingOverride = value
}
/**
* @param value Modifies HTTP target for HTTP tasks.
* Structure is documented below.
*/
@JvmName("tnvxnbptrkaeevlx")
public suspend fun httpTarget(`value`: Output) {
this.httpTarget = value
}
/**
* @param value The location of the queue
* - - -
*/
@JvmName("oqdyfjobochfkmtw")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value The queue name.
*/
@JvmName("unvhiovnulfkgybv")
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("blqfqbflehmbhnei")
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("embvofstjxdnvdkw")
public suspend fun rateLimits(`value`: Output) {
this.rateLimits = value
}
/**
* @param value Settings that determine the retry behavior.
* Structure is documented below.
*/
@JvmName("nytlxgbeamxnilbs")
public suspend fun retryConfig(`value`: Output) {
this.retryConfig = value
}
/**
* @param value Configuration options for writing logs to Stackdriver Logging.
* Structure is documented below.
*/
@JvmName("kjhpvhiwjoxcyknl")
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("wmcptojkxfxlgohn")
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("oiiogdrgkulimggw")
public suspend fun appEngineRoutingOverride(argument: suspend QueueAppEngineRoutingOverrideArgsBuilder.() -> Unit) {
val toBeMapped = QueueAppEngineRoutingOverrideArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.appEngineRoutingOverride = mapped
}
/**
* @param value Modifies HTTP target for HTTP tasks.
* Structure is documented below.
*/
@JvmName("cxpuruhmjngqqmsh")
public suspend fun httpTarget(`value`: QueueHttpTargetArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.httpTarget = mapped
}
/**
* @param argument Modifies HTTP target for HTTP tasks.
* Structure is documented below.
*/
@JvmName("anwiswbooiaukmkf")
public suspend fun httpTarget(argument: suspend QueueHttpTargetArgsBuilder.() -> Unit) {
val toBeMapped = QueueHttpTargetArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.httpTarget = mapped
}
/**
* @param value The location of the queue
* - - -
*/
@JvmName("wekdtjuiumsdfvcd")
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("akqmsqhaswnwmgst")
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("tehwwtnvqrqfyqnl")
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("xpalbuhbrxkhdbgc")
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("xyoflakjoxvvwlaa")
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("esnfeedcpquningn")
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("ragmdiokhokawfvr")
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("geaffgybklwmydni")
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("gtmgyamspumhbnkp")
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,
httpTarget = httpTarget,
location = location,
name = name,
project = project,
rateLimits = rateLimits,
retryConfig = retryConfig,
stackdriverLoggingConfig = stackdriverLoggingConfig,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy