UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

113 lines 5.48 kB
"use strict"; // *** 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.MessageQueue = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Allows management of [Yandex.Cloud Message Queue](https://cloud.yandex.com/docs/message-queue). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const exampleDeadletterQueue = new yandex.MessageQueue("exampleDeadletterQueue", {}); * const exampleQueue = new yandex.MessageQueue("exampleQueue", { * visibilityTimeoutSeconds: 600, * receiveWaitTimeSeconds: 20, * messageRetentionSeconds: 1209600, * redrivePolicy: exampleDeadletterQueue.arn.apply(arn => JSON.stringify({ * deadLetterTargetArn: arn, * maxReceiveCount: 3, * })), * }); * ``` * ## FIFO queue * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const exampleFifoQueue = new yandex.MessageQueue("example_fifo_queue", { * contentBasedDeduplication: true, * fifoQueue: true, * }); * ``` * * ## Import * * Yandex Message Queues can be imported using its `queue url`, e.g. * * ```sh * $ pulumi import yandex:index/messageQueue:MessageQueue example_import_queue https://message-queue.api.cloud.yandex.net/abcdefghijklmn123456/opqrstuvwxyz87654321/ymq_terraform_import_example * ``` */ class MessageQueue extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessKey"] = state ? state.accessKey : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["contentBasedDeduplication"] = state ? state.contentBasedDeduplication : undefined; resourceInputs["delaySeconds"] = state ? state.delaySeconds : undefined; resourceInputs["fifoQueue"] = state ? state.fifoQueue : undefined; resourceInputs["maxMessageSize"] = state ? state.maxMessageSize : undefined; resourceInputs["messageRetentionSeconds"] = state ? state.messageRetentionSeconds : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namePrefix"] = state ? state.namePrefix : undefined; resourceInputs["receiveWaitTimeSeconds"] = state ? state.receiveWaitTimeSeconds : undefined; resourceInputs["redrivePolicy"] = state ? state.redrivePolicy : undefined; resourceInputs["secretKey"] = state ? state.secretKey : undefined; resourceInputs["visibilityTimeoutSeconds"] = state ? state.visibilityTimeoutSeconds : undefined; } else { const args = argsOrState; resourceInputs["accessKey"] = args ? args.accessKey : undefined; resourceInputs["contentBasedDeduplication"] = args ? args.contentBasedDeduplication : undefined; resourceInputs["delaySeconds"] = args ? args.delaySeconds : undefined; resourceInputs["fifoQueue"] = args ? args.fifoQueue : undefined; resourceInputs["maxMessageSize"] = args ? args.maxMessageSize : undefined; resourceInputs["messageRetentionSeconds"] = args ? args.messageRetentionSeconds : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["namePrefix"] = args ? args.namePrefix : undefined; resourceInputs["receiveWaitTimeSeconds"] = args ? args.receiveWaitTimeSeconds : undefined; resourceInputs["redrivePolicy"] = args ? args.redrivePolicy : undefined; resourceInputs["secretKey"] = args ? args.secretKey : undefined; resourceInputs["visibilityTimeoutSeconds"] = args ? args.visibilityTimeoutSeconds : undefined; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MessageQueue.__pulumiType, name, resourceInputs, opts); } /** * Get an existing MessageQueue 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 MessageQueue(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MessageQueue. 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'] === MessageQueue.__pulumiType; } } exports.MessageQueue = MessageQueue; /** @internal */ MessageQueue.__pulumiType = 'yandex:index/messageQueue:MessageQueue'; //# sourceMappingURL=messageQueue.js.map