@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
141 lines • 7.24 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.PlatformApplication = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an SNS platform application resource
*
* ## Example Usage
*
* ### Apple Push Notification Service (APNS) using certificate-based authentication
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const apnsApplication = new aws.sns.PlatformApplication("apns_application", {
* name: "apns_application",
* platform: "APNS",
* platformCredential: "<APNS PRIVATE KEY>",
* platformPrincipal: "<APNS CERTIFICATE>",
* });
* ```
*
* ### Apple Push Notification Service (APNS) using token-based authentication
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const apnsApplication = new aws.sns.PlatformApplication("apns_application", {
* name: "apns_application",
* platform: "APNS",
* platformCredential: "<APNS SIGNING KEY>",
* platformPrincipal: "<APNS SIGNING KEY ID>",
* applePlatformTeamId: "<APPLE TEAM ID>",
* applePlatformBundleId: "<APPLE BUNDLE ID>",
* });
* ```
*
* ### Google Cloud Messaging (GCM)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const gcmApplication = new aws.sns.PlatformApplication("gcm_application", {
* name: "gcm_application",
* platform: "GCM",
* platformCredential: "<GCM API KEY>",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import SNS platform applications using the ARN. For example:
*
* ```sh
* $ pulumi import aws:sns/platformApplication:PlatformApplication gcm_application arn:aws:sns:us-west-2:123456789012:app/GCM/gcm_application
* ```
*/
class PlatformApplication extends pulumi.CustomResource {
/**
* Get an existing PlatformApplication 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 PlatformApplication(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of PlatformApplication. 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'] === PlatformApplication.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["applePlatformBundleId"] = state ? state.applePlatformBundleId : undefined;
resourceInputs["applePlatformTeamId"] = state ? state.applePlatformTeamId : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["eventDeliveryFailureTopicArn"] = state ? state.eventDeliveryFailureTopicArn : undefined;
resourceInputs["eventEndpointCreatedTopicArn"] = state ? state.eventEndpointCreatedTopicArn : undefined;
resourceInputs["eventEndpointDeletedTopicArn"] = state ? state.eventEndpointDeletedTopicArn : undefined;
resourceInputs["eventEndpointUpdatedTopicArn"] = state ? state.eventEndpointUpdatedTopicArn : undefined;
resourceInputs["failureFeedbackRoleArn"] = state ? state.failureFeedbackRoleArn : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["platform"] = state ? state.platform : undefined;
resourceInputs["platformCredential"] = state ? state.platformCredential : undefined;
resourceInputs["platformPrincipal"] = state ? state.platformPrincipal : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["successFeedbackRoleArn"] = state ? state.successFeedbackRoleArn : undefined;
resourceInputs["successFeedbackSampleRate"] = state ? state.successFeedbackSampleRate : undefined;
}
else {
const args = argsOrState;
if ((!args || args.platform === undefined) && !opts.urn) {
throw new Error("Missing required property 'platform'");
}
if ((!args || args.platformCredential === undefined) && !opts.urn) {
throw new Error("Missing required property 'platformCredential'");
}
resourceInputs["applePlatformBundleId"] = args ? args.applePlatformBundleId : undefined;
resourceInputs["applePlatformTeamId"] = args ? args.applePlatformTeamId : undefined;
resourceInputs["eventDeliveryFailureTopicArn"] = args ? args.eventDeliveryFailureTopicArn : undefined;
resourceInputs["eventEndpointCreatedTopicArn"] = args ? args.eventEndpointCreatedTopicArn : undefined;
resourceInputs["eventEndpointDeletedTopicArn"] = args ? args.eventEndpointDeletedTopicArn : undefined;
resourceInputs["eventEndpointUpdatedTopicArn"] = args ? args.eventEndpointUpdatedTopicArn : undefined;
resourceInputs["failureFeedbackRoleArn"] = args ? args.failureFeedbackRoleArn : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["platform"] = args ? args.platform : undefined;
resourceInputs["platformCredential"] = (args === null || args === void 0 ? void 0 : args.platformCredential) ? pulumi.secret(args.platformCredential) : undefined;
resourceInputs["platformPrincipal"] = (args === null || args === void 0 ? void 0 : args.platformPrincipal) ? pulumi.secret(args.platformPrincipal) : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["successFeedbackRoleArn"] = args ? args.successFeedbackRoleArn : undefined;
resourceInputs["successFeedbackSampleRate"] = args ? args.successFeedbackSampleRate : undefined;
resourceInputs["arn"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["platformCredential", "platformPrincipal"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(PlatformApplication.__pulumiType, name, resourceInputs, opts);
}
}
exports.PlatformApplication = PlatformApplication;
/** @internal */
PlatformApplication.__pulumiType = 'aws:sns/platformApplication:PlatformApplication';
//# sourceMappingURL=platformApplication.js.map