@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
254 lines • 9.3 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Queue = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* 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",
* });
* ```
* ### 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,
* },
* });
* ```
* ### 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",
* },
* },
* });
* ```
* ### 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",
* },
* },
* });
* ```
*
* ## 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}}
* $ pulumi import gcp:cloudtasks/queue:Queue default {{project}}/{{location}}/{{name}}
* $ pulumi import gcp:cloudtasks/queue:Queue default {{location}}/{{name}}
* ```
*/
class Queue extends pulumi.CustomResource {
/**
* Get an existing Queue resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Queue(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:cloudtasks/queue:Queue';
/**
* Returns true if the given object is an instance of Queue. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Queue.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appEngineRoutingOverride"] = state?.appEngineRoutingOverride;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["desiredState"] = state?.desiredState;
resourceInputs["httpTarget"] = state?.httpTarget;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["rateLimits"] = state?.rateLimits;
resourceInputs["retryConfig"] = state?.retryConfig;
resourceInputs["stackdriverLoggingConfig"] = state?.stackdriverLoggingConfig;
resourceInputs["state"] = state?.state;
}
else {
const args = argsOrState;
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["appEngineRoutingOverride"] = args?.appEngineRoutingOverride;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["desiredState"] = args?.desiredState;
resourceInputs["httpTarget"] = args?.httpTarget;
resourceInputs["location"] = args?.location;
resourceInputs["name"] = args?.name;
resourceInputs["project"] = args?.project;
resourceInputs["rateLimits"] = args?.rateLimits;
resourceInputs["retryConfig"] = args?.retryConfig;
resourceInputs["stackdriverLoggingConfig"] = args?.stackdriverLoggingConfig;
resourceInputs["state"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Queue.__pulumiType, name, resourceInputs, opts);
}
}
exports.Queue = Queue;
//# sourceMappingURL=queue.js.map