@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
233 lines • 8.25 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Queue = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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}}
* ```
*
* ```sh
* $ pulumi import gcp:cloudtasks/queue:Queue default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ 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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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 ? state.appEngineRoutingOverride : undefined;
resourceInputs["httpTarget"] = state ? state.httpTarget : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["rateLimits"] = state ? state.rateLimits : undefined;
resourceInputs["retryConfig"] = state ? state.retryConfig : undefined;
resourceInputs["stackdriverLoggingConfig"] = state ? state.stackdriverLoggingConfig : undefined;
}
else {
const args = argsOrState;
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["appEngineRoutingOverride"] = args ? args.appEngineRoutingOverride : undefined;
resourceInputs["httpTarget"] = args ? args.httpTarget : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["rateLimits"] = args ? args.rateLimits : undefined;
resourceInputs["retryConfig"] = args ? args.retryConfig : undefined;
resourceInputs["stackdriverLoggingConfig"] = args ? args.stackdriverLoggingConfig : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Queue.__pulumiType, name, resourceInputs, opts);
}
}
exports.Queue = Queue;
/** @internal */
Queue.__pulumiType = 'gcp:cloudtasks/queue:Queue';
//# sourceMappingURL=queue.js.map