@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
191 lines • 10.6 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! ***
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, Object.assign(Object.assign({}, 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 ? state.applicationFailureFeedbackRoleArn : undefined;
resourceInputs["applicationSuccessFeedbackRoleArn"] = state ? state.applicationSuccessFeedbackRoleArn : undefined;
resourceInputs["applicationSuccessFeedbackSampleRate"] = state ? state.applicationSuccessFeedbackSampleRate : undefined;
resourceInputs["archivePolicy"] = state ? state.archivePolicy : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["beginningArchiveTime"] = state ? state.beginningArchiveTime : undefined;
resourceInputs["contentBasedDeduplication"] = state ? state.contentBasedDeduplication : undefined;
resourceInputs["deliveryPolicy"] = state ? state.deliveryPolicy : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["fifoThroughputScope"] = state ? state.fifoThroughputScope : undefined;
resourceInputs["fifoTopic"] = state ? state.fifoTopic : undefined;
resourceInputs["firehoseFailureFeedbackRoleArn"] = state ? state.firehoseFailureFeedbackRoleArn : undefined;
resourceInputs["firehoseSuccessFeedbackRoleArn"] = state ? state.firehoseSuccessFeedbackRoleArn : undefined;
resourceInputs["firehoseSuccessFeedbackSampleRate"] = state ? state.firehoseSuccessFeedbackSampleRate : undefined;
resourceInputs["httpFailureFeedbackRoleArn"] = state ? state.httpFailureFeedbackRoleArn : undefined;
resourceInputs["httpSuccessFeedbackRoleArn"] = state ? state.httpSuccessFeedbackRoleArn : undefined;
resourceInputs["httpSuccessFeedbackSampleRate"] = state ? state.httpSuccessFeedbackSampleRate : undefined;
resourceInputs["kmsMasterKeyId"] = state ? state.kmsMasterKeyId : undefined;
resourceInputs["lambdaFailureFeedbackRoleArn"] = state ? state.lambdaFailureFeedbackRoleArn : undefined;
resourceInputs["lambdaSuccessFeedbackRoleArn"] = state ? state.lambdaSuccessFeedbackRoleArn : undefined;
resourceInputs["lambdaSuccessFeedbackSampleRate"] = state ? state.lambdaSuccessFeedbackSampleRate : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["namePrefix"] = state ? state.namePrefix : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["policy"] = state ? state.policy : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["signatureVersion"] = state ? state.signatureVersion : undefined;
resourceInputs["sqsFailureFeedbackRoleArn"] = state ? state.sqsFailureFeedbackRoleArn : undefined;
resourceInputs["sqsSuccessFeedbackRoleArn"] = state ? state.sqsSuccessFeedbackRoleArn : undefined;
resourceInputs["sqsSuccessFeedbackSampleRate"] = state ? state.sqsSuccessFeedbackSampleRate : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["tracingConfig"] = state ? state.tracingConfig : undefined;
}
else {
const args = argsOrState;
resourceInputs["applicationFailureFeedbackRoleArn"] = args ? args.applicationFailureFeedbackRoleArn : undefined;
resourceInputs["applicationSuccessFeedbackRoleArn"] = args ? args.applicationSuccessFeedbackRoleArn : undefined;
resourceInputs["applicationSuccessFeedbackSampleRate"] = args ? args.applicationSuccessFeedbackSampleRate : undefined;
resourceInputs["archivePolicy"] = args ? args.archivePolicy : undefined;
resourceInputs["contentBasedDeduplication"] = args ? args.contentBasedDeduplication : undefined;
resourceInputs["deliveryPolicy"] = args ? args.deliveryPolicy : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["fifoThroughputScope"] = args ? args.fifoThroughputScope : undefined;
resourceInputs["fifoTopic"] = args ? args.fifoTopic : undefined;
resourceInputs["firehoseFailureFeedbackRoleArn"] = args ? args.firehoseFailureFeedbackRoleArn : undefined;
resourceInputs["firehoseSuccessFeedbackRoleArn"] = args ? args.firehoseSuccessFeedbackRoleArn : undefined;
resourceInputs["firehoseSuccessFeedbackSampleRate"] = args ? args.firehoseSuccessFeedbackSampleRate : undefined;
resourceInputs["httpFailureFeedbackRoleArn"] = args ? args.httpFailureFeedbackRoleArn : undefined;
resourceInputs["httpSuccessFeedbackRoleArn"] = args ? args.httpSuccessFeedbackRoleArn : undefined;
resourceInputs["httpSuccessFeedbackSampleRate"] = args ? args.httpSuccessFeedbackSampleRate : undefined;
resourceInputs["kmsMasterKeyId"] = args ? args.kmsMasterKeyId : undefined;
resourceInputs["lambdaFailureFeedbackRoleArn"] = args ? args.lambdaFailureFeedbackRoleArn : undefined;
resourceInputs["lambdaSuccessFeedbackRoleArn"] = args ? args.lambdaSuccessFeedbackRoleArn : undefined;
resourceInputs["lambdaSuccessFeedbackSampleRate"] = args ? args.lambdaSuccessFeedbackSampleRate : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["namePrefix"] = args ? args.namePrefix : undefined;
resourceInputs["policy"] = args ? args.policy : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["signatureVersion"] = args ? args.signatureVersion : undefined;
resourceInputs["sqsFailureFeedbackRoleArn"] = args ? args.sqsFailureFeedbackRoleArn : undefined;
resourceInputs["sqsSuccessFeedbackRoleArn"] = args ? args.sqsSuccessFeedbackRoleArn : undefined;
resourceInputs["sqsSuccessFeedbackSampleRate"] = args ? args.sqsSuccessFeedbackSampleRate : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tracingConfig"] = args ? args.tracingConfig : undefined;
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