UNPKG

@pulumi/aws

Version:

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

99 lines 3.93 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.IdentityPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a SES Identity Policy. More information about SES Sending Authorization Policies can be found in the [SES Developer Guide](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-policies.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const exampleDomainIdentity = new aws.ses.DomainIdentity("example", {domain: "example.com"}); * const example = aws.iam.getPolicyDocumentOutput({ * statements: [{ * actions: [ * "SES:SendEmail", * "SES:SendRawEmail", * ], * resources: [exampleDomainIdentity.arn], * principals: [{ * identifiers: ["*"], * type: "AWS", * }], * }], * }); * const exampleIdentityPolicy = new aws.ses.IdentityPolicy("example", { * identity: exampleDomainIdentity.arn, * name: "example", * policy: example.apply(example => example.json), * }); * ``` * * ## Import * * Using `pulumi import`, import SES Identity Policies using the identity and policy name, separated by a pipe character (`|`). For example: * * ```sh * $ pulumi import aws:ses/identityPolicy:IdentityPolicy example 'example.com|example' * ``` */ class IdentityPolicy extends pulumi.CustomResource { /** * Get an existing IdentityPolicy 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 IdentityPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of IdentityPolicy. 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'] === IdentityPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["identity"] = state?.identity; resourceInputs["name"] = state?.name; resourceInputs["policy"] = state?.policy; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.identity === undefined && !opts.urn) { throw new Error("Missing required property 'identity'"); } if (args?.policy === undefined && !opts.urn) { throw new Error("Missing required property 'policy'"); } resourceInputs["identity"] = args?.identity; resourceInputs["name"] = args?.name; resourceInputs["policy"] = args?.policy; resourceInputs["region"] = args?.region; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(IdentityPolicy.__pulumiType, name, resourceInputs, opts); } } exports.IdentityPolicy = IdentityPolicy; /** @internal */ IdentityPolicy.__pulumiType = 'aws:ses/identityPolicy:IdentityPolicy'; //# sourceMappingURL=identityPolicy.js.map