UNPKG

@pulumi/aws

Version:

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

153 lines 5.89 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.Domain = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an Amazon Customer Profiles Domain. * See the [Create Domain](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_CreateDomain.html) for more information. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.customerprofiles.Domain("example", {domainName: "example"}); * ``` * * ### With SQS DLQ and KMS set * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.sqs.Queue("example", { * name: "example", * policy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Sid: "Customer Profiles SQS policy", * Effect: "Allow", * Action: ["sqs:SendMessage"], * Resource: "*", * Principal: { * Service: "profile.amazonaws.com", * }, * }], * }), * }); * const exampleKey = new aws.kms.Key("example", { * description: "example", * deletionWindowInDays: 10, * }); * const exampleBucket = new aws.s3.Bucket("example", { * bucket: "example", * forceDestroy: true, * }); * const exampleBucketPolicy = new aws.s3.BucketPolicy("example", { * bucket: exampleBucket.id, * policy: pulumi.jsonStringify({ * Version: "2012-10-17", * Statement: [{ * Sid: "Customer Profiles S3 policy", * Effect: "Allow", * Action: [ * "s3:GetObject", * "s3:PutObject", * "s3:ListBucket", * ], * Resource: [ * exampleBucket.arn, * pulumi.interpolate`${exampleBucket.arn}/*`, * ], * Principal: { * Service: "profile.amazonaws.com", * }, * }], * }), * }); * const test = new aws.customerprofiles.Domain("test", { * domainName: example, * deadLetterQueueUrl: example.id, * defaultEncryptionKey: exampleKey.arn, * defaultExpirationDays: 365, * }); * ``` * * ## Import * * Using `pulumi import`, import Amazon Customer Profiles Domain using the resource `id`. For example: * * ```sh * $ pulumi import aws:customerprofiles/domain:Domain example e6f777be-22d0-4b40-b307-5d2720ef16b2 * ``` */ class Domain extends pulumi.CustomResource { /** * Get an existing Domain 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 Domain(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Domain. 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'] === Domain.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["deadLetterQueueUrl"] = state?.deadLetterQueueUrl; resourceInputs["defaultEncryptionKey"] = state?.defaultEncryptionKey; resourceInputs["defaultExpirationDays"] = state?.defaultExpirationDays; resourceInputs["domainName"] = state?.domainName; resourceInputs["matching"] = state?.matching; resourceInputs["region"] = state?.region; resourceInputs["ruleBasedMatching"] = state?.ruleBasedMatching; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.defaultExpirationDays === undefined && !opts.urn) { throw new Error("Missing required property 'defaultExpirationDays'"); } if (args?.domainName === undefined && !opts.urn) { throw new Error("Missing required property 'domainName'"); } resourceInputs["deadLetterQueueUrl"] = args?.deadLetterQueueUrl; resourceInputs["defaultEncryptionKey"] = args?.defaultEncryptionKey; resourceInputs["defaultExpirationDays"] = args?.defaultExpirationDays; resourceInputs["domainName"] = args?.domainName; resourceInputs["matching"] = args?.matching; resourceInputs["region"] = args?.region; resourceInputs["ruleBasedMatching"] = args?.ruleBasedMatching; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Domain.__pulumiType, name, resourceInputs, opts); } } exports.Domain = Domain; /** @internal */ Domain.__pulumiType = 'aws:customerprofiles/domain:Domain'; //# sourceMappingURL=domain.js.map