UNPKG

@pulumi/aws

Version:

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

126 lines 5.5 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.EmailChannel = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Pinpoint Email Channel resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const app = new aws.pinpoint.App("app", {}); * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["pinpoint.amazonaws.com"], * }], * actions: ["sts:AssumeRole"], * }], * }); * const role = new aws.iam.Role("role", {assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json)}); * const email = new aws.pinpoint.EmailChannel("email", { * applicationId: app.applicationId, * fromAddress: "user@example.com", * roleArn: role.arn, * }); * const identity = new aws.ses.DomainIdentity("identity", {domain: "example.com"}); * const rolePolicy = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * actions: [ * "mobileanalytics:PutEvents", * "mobileanalytics:PutItems", * ], * resources: ["*"], * }], * }); * const rolePolicyRolePolicy = new aws.iam.RolePolicy("role_policy", { * name: "role_policy", * role: role.id, * policy: rolePolicy.then(rolePolicy => rolePolicy.json), * }); * ``` * * ## Import * * Using `pulumi import`, import Pinpoint Email Channel using the `application-id`. For example: * * ```sh * $ pulumi import aws:pinpoint/emailChannel:EmailChannel email application-id * ``` */ class EmailChannel extends pulumi.CustomResource { /** * Get an existing EmailChannel 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 EmailChannel(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of EmailChannel. 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'] === EmailChannel.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationId"] = state ? state.applicationId : undefined; resourceInputs["configurationSet"] = state ? state.configurationSet : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["fromAddress"] = state ? state.fromAddress : undefined; resourceInputs["identity"] = state ? state.identity : undefined; resourceInputs["messagesPerSecond"] = state ? state.messagesPerSecond : undefined; resourceInputs["orchestrationSendingRoleArn"] = state ? state.orchestrationSendingRoleArn : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["roleArn"] = state ? state.roleArn : undefined; } else { const args = argsOrState; if ((!args || args.applicationId === undefined) && !opts.urn) { throw new Error("Missing required property 'applicationId'"); } if ((!args || args.fromAddress === undefined) && !opts.urn) { throw new Error("Missing required property 'fromAddress'"); } if ((!args || args.identity === undefined) && !opts.urn) { throw new Error("Missing required property 'identity'"); } resourceInputs["applicationId"] = args ? args.applicationId : undefined; resourceInputs["configurationSet"] = args ? args.configurationSet : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["fromAddress"] = args ? args.fromAddress : undefined; resourceInputs["identity"] = args ? args.identity : undefined; resourceInputs["orchestrationSendingRoleArn"] = args ? args.orchestrationSendingRoleArn : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["roleArn"] = args ? args.roleArn : undefined; resourceInputs["messagesPerSecond"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EmailChannel.__pulumiType, name, resourceInputs, opts); } } exports.EmailChannel = EmailChannel; /** @internal */ EmailChannel.__pulumiType = 'aws:pinpoint/emailChannel:EmailChannel'; //# sourceMappingURL=emailChannel.js.map