UNPKG

@pulumi/aws

Version:

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

152 lines 6.17 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.DistributionTenant = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates an Amazon CloudFront distribution tenant. * * Distribution tenants allow you to create isolated configurations within a multi-tenant CloudFront distribution. Each tenant can have its own domains, customizations, and parameters while sharing the underlying distribution infrastructure. * * For information about CloudFront distribution tenants, see the [Amazon CloudFront Developer Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-tenants.html). * * ## Example Usage * * ### Basic Distribution Tenant * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudfront.DistributionTenant("example", { * name: "example-tenant", * distributionId: exampleAwsCloudfrontMultitenantDistribution.id, * enabled: true, * domains: [{ * domain: "tenant.example.com", * }], * tags: { * Environment: "production", * }, * }); * ``` * * ### Distribution Tenant with Customizations * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudfront.DistributionTenant("example", { * name: "example-tenant", * distributionId: exampleAwsCloudfrontMultitenantDistribution.id, * enabled: false, * domains: [{ * domain: "tenant.example.com", * }], * customizations: { * geoRestriction: { * restrictionType: "whitelist", * locations: [ * "US", * "CA", * ], * }, * certificate: { * arn: tenantCert.arn, * }, * webAcl: { * action: "override", * arn: tenantWaf.arn, * }, * }, * tags: { * Environment: "production", * Tenant: "example", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import CloudFront Distribution Tenants using the `id`. For example: * * ```sh * $ pulumi import aws:cloudfront/distributionTenant:DistributionTenant example TENANT123EXAMPLE * ``` */ class DistributionTenant extends pulumi.CustomResource { /** * Get an existing DistributionTenant 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 DistributionTenant(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of DistributionTenant. 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'] === DistributionTenant.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["connectionGroupId"] = state?.connectionGroupId; resourceInputs["customizations"] = state?.customizations; resourceInputs["distributionId"] = state?.distributionId; resourceInputs["domains"] = state?.domains; resourceInputs["enabled"] = state?.enabled; resourceInputs["etag"] = state?.etag; resourceInputs["managedCertificateRequest"] = state?.managedCertificateRequest; resourceInputs["name"] = state?.name; resourceInputs["parameters"] = state?.parameters; resourceInputs["status"] = state?.status; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["timeouts"] = state?.timeouts; resourceInputs["waitForDeployment"] = state?.waitForDeployment; } else { const args = argsOrState; if (args?.distributionId === undefined && !opts.urn) { throw new Error("Missing required property 'distributionId'"); } resourceInputs["connectionGroupId"] = args?.connectionGroupId; resourceInputs["customizations"] = args?.customizations; resourceInputs["distributionId"] = args?.distributionId; resourceInputs["domains"] = args?.domains; resourceInputs["enabled"] = args?.enabled; resourceInputs["managedCertificateRequest"] = args?.managedCertificateRequest; resourceInputs["name"] = args?.name; resourceInputs["parameters"] = args?.parameters; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["waitForDeployment"] = args?.waitForDeployment; resourceInputs["arn"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DistributionTenant.__pulumiType, name, resourceInputs, opts); } } exports.DistributionTenant = DistributionTenant; /** @internal */ DistributionTenant.__pulumiType = 'aws:cloudfront/distributionTenant:DistributionTenant'; //# sourceMappingURL=distributionTenant.js.map