@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
126 lines • 5.12 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.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, { ...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?.applicationId;
resourceInputs["configurationSet"] = state?.configurationSet;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["fromAddress"] = state?.fromAddress;
resourceInputs["identity"] = state?.identity;
resourceInputs["messagesPerSecond"] = state?.messagesPerSecond;
resourceInputs["orchestrationSendingRoleArn"] = state?.orchestrationSendingRoleArn;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
}
else {
const args = argsOrState;
if (args?.applicationId === undefined && !opts.urn) {
throw new Error("Missing required property 'applicationId'");
}
if (args?.fromAddress === undefined && !opts.urn) {
throw new Error("Missing required property 'fromAddress'");
}
if (args?.identity === undefined && !opts.urn) {
throw new Error("Missing required property 'identity'");
}
resourceInputs["applicationId"] = args?.applicationId;
resourceInputs["configurationSet"] = args?.configurationSet;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["fromAddress"] = args?.fromAddress;
resourceInputs["identity"] = args?.identity;
resourceInputs["orchestrationSendingRoleArn"] = args?.orchestrationSendingRoleArn;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
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