@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
141 lines • 6.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.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, { ...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?.applePlatformBundleId;
resourceInputs["applePlatformTeamId"] = state?.applePlatformTeamId;
resourceInputs["arn"] = state?.arn;
resourceInputs["eventDeliveryFailureTopicArn"] = state?.eventDeliveryFailureTopicArn;
resourceInputs["eventEndpointCreatedTopicArn"] = state?.eventEndpointCreatedTopicArn;
resourceInputs["eventEndpointDeletedTopicArn"] = state?.eventEndpointDeletedTopicArn;
resourceInputs["eventEndpointUpdatedTopicArn"] = state?.eventEndpointUpdatedTopicArn;
resourceInputs["failureFeedbackRoleArn"] = state?.failureFeedbackRoleArn;
resourceInputs["name"] = state?.name;
resourceInputs["platform"] = state?.platform;
resourceInputs["platformCredential"] = state?.platformCredential;
resourceInputs["platformPrincipal"] = state?.platformPrincipal;
resourceInputs["region"] = state?.region;
resourceInputs["successFeedbackRoleArn"] = state?.successFeedbackRoleArn;
resourceInputs["successFeedbackSampleRate"] = state?.successFeedbackSampleRate;
}
else {
const args = argsOrState;
if (args?.platform === undefined && !opts.urn) {
throw new Error("Missing required property 'platform'");
}
if (args?.platformCredential === undefined && !opts.urn) {
throw new Error("Missing required property 'platformCredential'");
}
resourceInputs["applePlatformBundleId"] = args?.applePlatformBundleId;
resourceInputs["applePlatformTeamId"] = args?.applePlatformTeamId;
resourceInputs["eventDeliveryFailureTopicArn"] = args?.eventDeliveryFailureTopicArn;
resourceInputs["eventEndpointCreatedTopicArn"] = args?.eventEndpointCreatedTopicArn;
resourceInputs["eventEndpointDeletedTopicArn"] = args?.eventEndpointDeletedTopicArn;
resourceInputs["eventEndpointUpdatedTopicArn"] = args?.eventEndpointUpdatedTopicArn;
resourceInputs["failureFeedbackRoleArn"] = args?.failureFeedbackRoleArn;
resourceInputs["name"] = args?.name;
resourceInputs["platform"] = args?.platform;
resourceInputs["platformCredential"] = args?.platformCredential ? pulumi.secret(args.platformCredential) : undefined;
resourceInputs["platformPrincipal"] = args?.platformPrincipal ? pulumi.secret(args.platformPrincipal) : undefined;
resourceInputs["region"] = args?.region;
resourceInputs["successFeedbackRoleArn"] = args?.successFeedbackRoleArn;
resourceInputs["successFeedbackSampleRate"] = args?.successFeedbackSampleRate;
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