@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
176 lines • 7.67 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");
/**
* The ``AWS::SNS::Topic`` resource creates a topic to which notifications can be published.
* One account can create a maximum of 100,000 standard topics and 1,000 FIFO topics. For more information, see [endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/sns.html) in the *General Reference*.
* The structure of ``AUTHPARAMS`` depends on the .signature of the API request. For more information, see [Examples of the complete Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html) in the *General Reference*.
*
* ## Example Usage
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const carSalesTopic = new aws_native.sns.Topic("carSalesTopic", {});
* const erpIntegrationQueue = new aws_native.sqs.Queue("erpIntegrationQueue", {});
* const erpSubscription = new aws_native.sns.Subscription("erpSubscription", {
* topicArn: carSalesTopic.id,
* endpoint: erpIntegrationQueue.arn,
* protocol: "sqs",
* rawMessageDelivery: true,
* });
* const crmIntegrationQueue = new aws_native.sqs.Queue("crmIntegrationQueue", {});
* const crmSubscription = new aws_native.sns.Subscription("crmSubscription", {
* topicArn: carSalesTopic.id,
* endpoint: crmIntegrationQueue.arn,
* protocol: "sqs",
* rawMessageDelivery: true,
* filterPolicy: {
* "buyer-class": ["vip"],
* },
* });
* const config = new pulumi.Config();
* const myHttpEndpoint = config.require("myHttpEndpoint");
* const scmSubscription = new aws_native.sns.Subscription("scmSubscription", {
* topicArn: carSalesTopic.id,
* endpoint: myHttpEndpoint,
* protocol: "https",
* deliveryPolicy: {
* healthyRetryPolicy: {
* numRetries: 20,
* minDelayTarget: 10,
* maxDelayTarget: 30,
* numMinDelayRetries: 3,
* numMaxDelayRetries: 17,
* numNoDelayRetries: 0,
* backoffFunction: "exponential",
* },
* },
* });
*
* ```
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const carSalesTopic = new aws_native.sns.Topic("carSalesTopic", {});
* const erpIntegrationQueue = new aws_native.sqs.Queue("erpIntegrationQueue", {});
* const erpSubscription = new aws_native.sns.Subscription("erpSubscription", {
* topicArn: carSalesTopic.id,
* endpoint: erpIntegrationQueue.arn,
* protocol: "sqs",
* rawMessageDelivery: true,
* });
* const crmIntegrationQueue = new aws_native.sqs.Queue("crmIntegrationQueue", {});
* const crmSubscription = new aws_native.sns.Subscription("crmSubscription", {
* topicArn: carSalesTopic.id,
* endpoint: crmIntegrationQueue.arn,
* protocol: "sqs",
* rawMessageDelivery: true,
* filterPolicy: {
* "buyer-class": ["vip"],
* },
* });
* const config = new pulumi.Config();
* const myHttpEndpoint = config.require("myHttpEndpoint");
* const scmSubscription = new aws_native.sns.Subscription("scmSubscription", {
* topicArn: carSalesTopic.id,
* endpoint: myHttpEndpoint,
* protocol: "https",
* deliveryPolicy: {
* healthyRetryPolicy: {
* numRetries: 20,
* minDelayTarget: 10,
* maxDelayTarget: 30,
* numMinDelayRetries: 3,
* numMaxDelayRetries: 17,
* numNoDelayRetries: 0,
* backoffFunction: "exponential",
* },
* },
* });
*
* ```
*/
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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new Topic(name, undefined, { ...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;
}
/**
* Create a Topic resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
resourceInputs["archivePolicy"] = args?.archivePolicy;
resourceInputs["contentBasedDeduplication"] = args?.contentBasedDeduplication;
resourceInputs["dataProtectionPolicy"] = args?.dataProtectionPolicy;
resourceInputs["deliveryStatusLogging"] = args?.deliveryStatusLogging;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["fifoThroughputScope"] = args?.fifoThroughputScope;
resourceInputs["fifoTopic"] = args?.fifoTopic;
resourceInputs["kmsMasterKeyId"] = args?.kmsMasterKeyId;
resourceInputs["signatureVersion"] = args?.signatureVersion;
resourceInputs["subscription"] = args?.subscription;
resourceInputs["tags"] = args?.tags;
resourceInputs["topicName"] = args?.topicName;
resourceInputs["tracingConfig"] = args?.tracingConfig;
resourceInputs["topicArn"] = undefined /*out*/;
}
else {
resourceInputs["archivePolicy"] = undefined /*out*/;
resourceInputs["contentBasedDeduplication"] = undefined /*out*/;
resourceInputs["dataProtectionPolicy"] = undefined /*out*/;
resourceInputs["deliveryStatusLogging"] = undefined /*out*/;
resourceInputs["displayName"] = undefined /*out*/;
resourceInputs["fifoThroughputScope"] = undefined /*out*/;
resourceInputs["fifoTopic"] = undefined /*out*/;
resourceInputs["kmsMasterKeyId"] = undefined /*out*/;
resourceInputs["signatureVersion"] = undefined /*out*/;
resourceInputs["subscription"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
resourceInputs["topicArn"] = undefined /*out*/;
resourceInputs["topicName"] = undefined /*out*/;
resourceInputs["tracingConfig"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["fifoTopic", "topicName"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(Topic.__pulumiType, name, resourceInputs, opts);
}
}
exports.Topic = Topic;
/** @internal */
Topic.__pulumiType = 'aws-native:sns:Topic';
//# sourceMappingURL=topic.js.map