UNPKG

@pulumi/aws

Version:

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

112 lines 4.3 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.EmailIdentityPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS SESv2 (Simple Email V2) Email Identity Policy. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.sesv2.EmailIdentity("example", {emailIdentity: "testing@example.com"}); * const exampleEmailIdentityPolicy = new aws.sesv2.EmailIdentityPolicy("example", { * emailIdentity: example.emailIdentity, * policyName: "example", * policy: pulumi.interpolate`{ * "Id":"ExampleAuthorizationPolicy", * "Version":"2012-10-17", * "Statement":[ * { * "Sid":"AuthorizeIAMUser", * "Effect":"Allow", * "Resource":"${example.arn}", * "Principal":{ * "AWS":[ * "arn:aws:iam::123456789012:user/John", * "arn:aws:iam::123456789012:user/Jane" * ] * }, * "Action":[ * "ses:DeleteEmailIdentity", * "ses:PutEmailIdentityDkimSigningAttributes" * ] * } * ] * } * `, * }); * ``` * * ## Import * * Using `pulumi import`, import SESv2 (Simple Email V2) Email Identity Policy using the `email_identity` and `policy_name` separated by `|`. For example: * * ```sh * $ pulumi import aws:sesv2/emailIdentityPolicy:EmailIdentityPolicy example example_email_identity|example_policy_name * ``` */ class EmailIdentityPolicy extends pulumi.CustomResource { /** * Get an existing EmailIdentityPolicy 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 EmailIdentityPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of EmailIdentityPolicy. 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'] === EmailIdentityPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["emailIdentity"] = state?.emailIdentity; resourceInputs["policy"] = state?.policy; resourceInputs["policyName"] = state?.policyName; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.emailIdentity === undefined && !opts.urn) { throw new Error("Missing required property 'emailIdentity'"); } if (args?.policy === undefined && !opts.urn) { throw new Error("Missing required property 'policy'"); } if (args?.policyName === undefined && !opts.urn) { throw new Error("Missing required property 'policyName'"); } resourceInputs["emailIdentity"] = args?.emailIdentity; resourceInputs["policy"] = args?.policy; resourceInputs["policyName"] = args?.policyName; resourceInputs["region"] = args?.region; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EmailIdentityPolicy.__pulumiType, name, resourceInputs, opts); } } exports.EmailIdentityPolicy = EmailIdentityPolicy; /** @internal */ EmailIdentityPolicy.__pulumiType = 'aws:sesv2/emailIdentityPolicy:EmailIdentityPolicy'; //# sourceMappingURL=emailIdentityPolicy.js.map