UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

191 lines • 9.45 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Topic = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an SNS topic resource * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const userUpdates = new aws.sns.Topic("user_updates", {name: "user-updates-topic"}); * ``` * * ## Example with Delivery Policy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const userUpdates = new aws.sns.Topic("user_updates", { * name: "user-updates-topic", * deliveryPolicy: `{ * "http": { * "defaultHealthyRetryPolicy": { * "minDelayTarget": 20, * "maxDelayTarget": 20, * "numRetries": 3, * "numMaxDelayRetries": 0, * "numNoDelayRetries": 0, * "numMinDelayRetries": 0, * "backoffFunction": "linear" * }, * "disableSubscriptionOverrides": false, * "defaultThrottlePolicy": { * "maxReceivesPerSecond": 1 * } * } * } * `, * }); * ``` * * ## Example with Server-side encryption (SSE) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const userUpdates = new aws.sns.Topic("user_updates", { * name: "user-updates-topic", * kmsMasterKeyId: "alias/aws/sns", * }); * ``` * * ## Example with First-In-First-Out (FIFO) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const userUpdates = new aws.sns.Topic("user_updates", { * name: "user-updates-topic.fifo", * fifoTopic: true, * contentBasedDeduplication: true, * }); * ``` * * ## Message Delivery Status Arguments * * The `<endpoint>_success_feedback_role_arn` and `<endpoint>_failure_feedback_role_arn` arguments are used to give Amazon SNS write access to use CloudWatch Logs on your behalf. The `<endpoint>_success_feedback_sample_rate` argument is for specifying the sample rate percentage (0-100) of successfully delivered messages. After you configure the `<endpoint>_failure_feedback_role_arn` argument, then all failed message deliveries generate CloudWatch Logs. * * ## Import * * Using `pulumi import`, import SNS Topics using the topic `arn`. For example: * * ```sh * $ pulumi import aws:sns/topic:Topic user_updates arn:aws:sns:us-west-2:123456789012:my-topic * ``` */ class Topic extends pulumi.CustomResource { /** * Get an existing Topic 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 Topic(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Topic. 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'] === Topic.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationFailureFeedbackRoleArn"] = state?.applicationFailureFeedbackRoleArn; resourceInputs["applicationSuccessFeedbackRoleArn"] = state?.applicationSuccessFeedbackRoleArn; resourceInputs["applicationSuccessFeedbackSampleRate"] = state?.applicationSuccessFeedbackSampleRate; resourceInputs["archivePolicy"] = state?.archivePolicy; resourceInputs["arn"] = state?.arn; resourceInputs["beginningArchiveTime"] = state?.beginningArchiveTime; resourceInputs["contentBasedDeduplication"] = state?.contentBasedDeduplication; resourceInputs["deliveryPolicy"] = state?.deliveryPolicy; resourceInputs["displayName"] = state?.displayName; resourceInputs["fifoThroughputScope"] = state?.fifoThroughputScope; resourceInputs["fifoTopic"] = state?.fifoTopic; resourceInputs["firehoseFailureFeedbackRoleArn"] = state?.firehoseFailureFeedbackRoleArn; resourceInputs["firehoseSuccessFeedbackRoleArn"] = state?.firehoseSuccessFeedbackRoleArn; resourceInputs["firehoseSuccessFeedbackSampleRate"] = state?.firehoseSuccessFeedbackSampleRate; resourceInputs["httpFailureFeedbackRoleArn"] = state?.httpFailureFeedbackRoleArn; resourceInputs["httpSuccessFeedbackRoleArn"] = state?.httpSuccessFeedbackRoleArn; resourceInputs["httpSuccessFeedbackSampleRate"] = state?.httpSuccessFeedbackSampleRate; resourceInputs["kmsMasterKeyId"] = state?.kmsMasterKeyId; resourceInputs["lambdaFailureFeedbackRoleArn"] = state?.lambdaFailureFeedbackRoleArn; resourceInputs["lambdaSuccessFeedbackRoleArn"] = state?.lambdaSuccessFeedbackRoleArn; resourceInputs["lambdaSuccessFeedbackSampleRate"] = state?.lambdaSuccessFeedbackSampleRate; resourceInputs["name"] = state?.name; resourceInputs["namePrefix"] = state?.namePrefix; resourceInputs["owner"] = state?.owner; resourceInputs["policy"] = state?.policy; resourceInputs["region"] = state?.region; resourceInputs["signatureVersion"] = state?.signatureVersion; resourceInputs["sqsFailureFeedbackRoleArn"] = state?.sqsFailureFeedbackRoleArn; resourceInputs["sqsSuccessFeedbackRoleArn"] = state?.sqsSuccessFeedbackRoleArn; resourceInputs["sqsSuccessFeedbackSampleRate"] = state?.sqsSuccessFeedbackSampleRate; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["tracingConfig"] = state?.tracingConfig; } else { const args = argsOrState; resourceInputs["applicationFailureFeedbackRoleArn"] = args?.applicationFailureFeedbackRoleArn; resourceInputs["applicationSuccessFeedbackRoleArn"] = args?.applicationSuccessFeedbackRoleArn; resourceInputs["applicationSuccessFeedbackSampleRate"] = args?.applicationSuccessFeedbackSampleRate; resourceInputs["archivePolicy"] = args?.archivePolicy; resourceInputs["contentBasedDeduplication"] = args?.contentBasedDeduplication; resourceInputs["deliveryPolicy"] = args?.deliveryPolicy; resourceInputs["displayName"] = args?.displayName; resourceInputs["fifoThroughputScope"] = args?.fifoThroughputScope; resourceInputs["fifoTopic"] = args?.fifoTopic; resourceInputs["firehoseFailureFeedbackRoleArn"] = args?.firehoseFailureFeedbackRoleArn; resourceInputs["firehoseSuccessFeedbackRoleArn"] = args?.firehoseSuccessFeedbackRoleArn; resourceInputs["firehoseSuccessFeedbackSampleRate"] = args?.firehoseSuccessFeedbackSampleRate; resourceInputs["httpFailureFeedbackRoleArn"] = args?.httpFailureFeedbackRoleArn; resourceInputs["httpSuccessFeedbackRoleArn"] = args?.httpSuccessFeedbackRoleArn; resourceInputs["httpSuccessFeedbackSampleRate"] = args?.httpSuccessFeedbackSampleRate; resourceInputs["kmsMasterKeyId"] = args?.kmsMasterKeyId; resourceInputs["lambdaFailureFeedbackRoleArn"] = args?.lambdaFailureFeedbackRoleArn; resourceInputs["lambdaSuccessFeedbackRoleArn"] = args?.lambdaSuccessFeedbackRoleArn; resourceInputs["lambdaSuccessFeedbackSampleRate"] = args?.lambdaSuccessFeedbackSampleRate; resourceInputs["name"] = args?.name; resourceInputs["namePrefix"] = args?.namePrefix; resourceInputs["policy"] = args?.policy; resourceInputs["region"] = args?.region; resourceInputs["signatureVersion"] = args?.signatureVersion; resourceInputs["sqsFailureFeedbackRoleArn"] = args?.sqsFailureFeedbackRoleArn; resourceInputs["sqsSuccessFeedbackRoleArn"] = args?.sqsSuccessFeedbackRoleArn; resourceInputs["sqsSuccessFeedbackSampleRate"] = args?.sqsSuccessFeedbackSampleRate; resourceInputs["tags"] = args?.tags; resourceInputs["tracingConfig"] = args?.tracingConfig; resourceInputs["arn"] = undefined /*out*/; resourceInputs["beginningArchiveTime"] = undefined /*out*/; resourceInputs["owner"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Topic.__pulumiType, name, resourceInputs, opts); } } exports.Topic = Topic; /** @internal */ Topic.__pulumiType = 'aws:sns/topic:Topic'; //# sourceMappingURL=topic.js.map