DistributionTenant class
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.
Example Usage
Basic Distribution Tenant
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.cloudfront.DistributionTenant("example", {
domains: [{
domain: "tenant.example.com",
}],
name: "example-tenant",
distributionId: exampleAwsCloudfrontMultitenantDistribution.id,
enabled: true,
tags: {
Environment: "production",
},
});
import pulumi
import pulumi_aws as aws
example = aws.cloudfront.DistributionTenant("example",
domains=[{
"domain": "tenant.example.com",
}],
name="example-tenant",
distribution_id=example_aws_cloudfront_multitenant_distribution["id"],
enabled=True,
tags={
"Environment": "production",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.CloudFront.DistributionTenant("example", new()
{
Domains = new[]
{
new Aws.CloudFront.Inputs.DistributionTenantDomainArgs
{
Domain = "tenant.example.com",
},
},
Name = "example-tenant",
DistributionId = exampleAwsCloudfrontMultitenantDistribution.Id,
Enabled = true,
Tags =
{
{ "Environment", "production" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudfront"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudfront.NewDistributionTenant(ctx, "example", &cloudfront.DistributionTenantArgs{
Domains: cloudfront.DistributionTenantDomainArray{
&cloudfront.DistributionTenantDomainArgs{
Domain: pulumi.String("tenant.example.com"),
},
},
Name: pulumi.String("example-tenant"),
DistributionId: pulumi.Any(exampleAwsCloudfrontMultitenantDistribution.Id),
Enabled: pulumi.Bool(true),
Tags: pulumi.StringMap{
"Environment": pulumi.String("production"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_cloudfront_distributiontenant" "example" {
domains {
domain = "tenant.example.com"
}
name = "example-tenant"
distribution_id = exampleAwsCloudfrontMultitenantDistribution.id
enabled = true
tags = {
"Environment" = "production"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.DistributionTenant;
import com.pulumi.aws.cloudfront.DistributionTenantArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionTenantDomainArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new DistributionTenant("example", DistributionTenantArgs.builder()
.domains(DistributionTenantDomainArgs.builder()
.domain("tenant.example.com")
.build())
.name("example-tenant")
.distributionId(exampleAwsCloudfrontMultitenantDistribution.id())
.enabled(true)
.tags(Map.of("Environment", "production"))
.build());
}
}
resources:
example:
type: aws:cloudfront:DistributionTenant
properties:
domains:
- domain: tenant.example.com
name: example-tenant
distributionId: ${exampleAwsCloudfrontMultitenantDistribution.id}
enabled: true
tags:
Environment: production
Distribution Tenant with Customizations
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.cloudfront.DistributionTenant("example", {
customizations: {
geoRestriction: {
restrictionType: "whitelist",
locations: [
"US",
"CA",
],
},
certificate: {
arn: tenantCert.arn,
},
webAcl: {
action: "override",
arn: tenantWaf.arn,
},
},
domains: [{
domain: "tenant.example.com",
}],
name: "example-tenant",
distributionId: exampleAwsCloudfrontMultitenantDistribution.id,
enabled: false,
tags: {
Environment: "production",
Tenant: "example",
},
});
import pulumi
import pulumi_aws as aws
example = aws.cloudfront.DistributionTenant("example",
customizations={
"geo_restriction": {
"restriction_type": "whitelist",
"locations": [
"US",
"CA",
],
},
"certificate": {
"arn": tenant_cert["arn"],
},
"web_acl": {
"action": "override",
"arn": tenant_waf["arn"],
},
},
domains=[{
"domain": "tenant.example.com",
}],
name="example-tenant",
distribution_id=example_aws_cloudfront_multitenant_distribution["id"],
enabled=False,
tags={
"Environment": "production",
"Tenant": "example",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.CloudFront.DistributionTenant("example", new()
{
Customizations = new Aws.CloudFront.Inputs.DistributionTenantCustomizationsArgs
{
GeoRestriction = new Aws.CloudFront.Inputs.DistributionTenantCustomizationsGeoRestrictionArgs
{
RestrictionType = "whitelist",
Locations = new[]
{
"US",
"CA",
},
},
Certificate = new Aws.CloudFront.Inputs.DistributionTenantCustomizationsCertificateArgs
{
Arn = tenantCert.Arn,
},
WebAcl = new Aws.CloudFront.Inputs.DistributionTenantCustomizationsWebAclArgs
{
Action = "override",
Arn = tenantWaf.Arn,
},
},
Domains = new[]
{
new Aws.CloudFront.Inputs.DistributionTenantDomainArgs
{
Domain = "tenant.example.com",
},
},
Name = "example-tenant",
DistributionId = exampleAwsCloudfrontMultitenantDistribution.Id,
Enabled = false,
Tags =
{
{ "Environment", "production" },
{ "Tenant", "example" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudfront"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudfront.NewDistributionTenant(ctx, "example", &cloudfront.DistributionTenantArgs{
Customizations: &cloudfront.DistributionTenantCustomizationsArgs{
GeoRestriction: &cloudfront.DistributionTenantCustomizationsGeoRestrictionArgs{
RestrictionType: pulumi.String("whitelist"),
Locations: pulumi.StringArray{
pulumi.String("US"),
pulumi.String("CA"),
},
},
Certificate: &cloudfront.DistributionTenantCustomizationsCertificateArgs{
Arn: pulumi.Any(tenantCert.Arn),
},
WebAcl: &cloudfront.DistributionTenantCustomizationsWebAclArgs{
Action: pulumi.String("override"),
Arn: pulumi.Any(tenantWaf.Arn),
},
},
Domains: cloudfront.DistributionTenantDomainArray{
&cloudfront.DistributionTenantDomainArgs{
Domain: pulumi.String("tenant.example.com"),
},
},
Name: pulumi.String("example-tenant"),
DistributionId: pulumi.Any(exampleAwsCloudfrontMultitenantDistribution.Id),
Enabled: pulumi.Bool(false),
Tags: pulumi.StringMap{
"Environment": pulumi.String("production"),
"Tenant": pulumi.String("example"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_cloudfront_distributiontenant" "example" {
customizations = {
geo_restriction = {
restriction_type = "whitelist"
locations = ["US", "CA"]
}
certificate = {
arn = tenantCert.arn
}
web_acl = {
action = "override"
arn = tenantWaf.arn
}
}
domains {
domain = "tenant.example.com"
}
name = "example-tenant"
distribution_id = exampleAwsCloudfrontMultitenantDistribution.id
enabled = false
tags = {
"Environment" = "production"
"Tenant" = "example"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.DistributionTenant;
import com.pulumi.aws.cloudfront.DistributionTenantArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionTenantCustomizationsArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionTenantCustomizationsGeoRestrictionArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionTenantCustomizationsCertificateArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionTenantCustomizationsWebAclArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionTenantDomainArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new DistributionTenant("example", DistributionTenantArgs.builder()
.customizations(DistributionTenantCustomizationsArgs.builder()
.geoRestriction(DistributionTenantCustomizationsGeoRestrictionArgs.builder()
.restrictionType("whitelist")
.locations(
"US",
"CA")
.build())
.certificate(DistributionTenantCustomizationsCertificateArgs.builder()
.arn(tenantCert.arn())
.build())
.webAcl(DistributionTenantCustomizationsWebAclArgs.builder()
.action("override")
.arn(tenantWaf.arn())
.build())
.build())
.domains(DistributionTenantDomainArgs.builder()
.domain("tenant.example.com")
.build())
.name("example-tenant")
.distributionId(exampleAwsCloudfrontMultitenantDistribution.id())
.enabled(false)
.tags(Map.ofEntries(
Map.entry("Environment", "production"),
Map.entry("Tenant", "example")
))
.build());
}
}
resources:
example:
type: aws:cloudfront:DistributionTenant
properties:
customizations:
geoRestriction:
restrictionType: whitelist
locations:
- US
- CA
certificate:
arn: ${tenantCert.arn}
webAcl:
action: override
arn: ${tenantWaf.arn}
domains:
- domain: tenant.example.com
name: example-tenant
distributionId: ${exampleAwsCloudfrontMultitenantDistribution.id}
enabled: false
tags:
Environment: production
Tenant: example
Import
Using pulumi import, import CloudFront Distribution Tenants using the id. For example:
$ pulumi import aws:cloudfront/distributionTenant:DistributionTenant example TENANT123EXAMPLE
Constructors
- DistributionTenant(String name, {DistributionTenantArgs? args, CustomResourceOptions? options})
-
Creates a new DistributionTenant.
nameThe Pulumi resource name.argsArguments used to configure this DistributionTenant. The set of arguments for DistributionTenant.optionsResource options controlling this resource's behavior. - DistributionTenant.reference(String urn)
- Creates a typed reference to an existing DistributionTenant resource.
Properties
-
arn
↔ Output<
String> -
ARN of the distribution tenant.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
connectionGroupId
↔ Output<
String> -
ID of the connection group for the distribution tenant. If not specified, CloudFront uses the default connection group.
latefinal
-
customizations
↔ Output<
DistributionTenantCustomizations?> -
Customizations for the distribution tenant (maximum one).
latefinal
-
distributionId
↔ Output<
String> -
ID of the multi-tenant distribution.
latefinal
-
domains
↔ Output<
List< DistributionTenantDomain> ?> -
Set of domains associated with the distribution tenant.
latefinal
-
enabled
↔ Output<
bool> -
Whether the distribution tenant is enabled to serve traffic. Defaults to
true.latefinal -
etag
↔ Output<
String> -
Current version of the distribution tenant.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
managedCertificateRequest
↔ Output<
DistributionTenantManagedCertificateRequest?> -
Managed certificate request for CloudFront managed ACM certificate (maximum one).
latefinal
-
name
↔ Output<
String> -
Name of the distribution tenant.
latefinal
-
parameters
↔ Output<
List< DistributionTenantParameter> ?> -
Set of parameter values for the distribution tenant.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
status
↔ Output<
String> -
Current status of the distribution tenant.
latefinal
-
Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
timeouts
↔ Output<
DistributionTenantTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
waitForDeployment
↔ Output<
bool> -
If enabled, the resource will wait for the distribution tenant status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {DistributionTenantState? state, CustomResourceOptions? options}) → DistributionTenant -
Gets an existing DistributionTenant resource's state with the given
nameandid.