Class CfnDistributionTenant
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.cloudfront.CfnDistributionTenant
- All Implemented Interfaces:
IInspectable,IDistributionTenantRef,IEnvironmentAware,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:00.494Z")
@Stability(Stable)
public class CfnDistributionTenant
extends CfnResource
implements IInspectable, IDistributionTenantRef, ITaggableV2
The distribution tenant.
Example:
// Create the simple Origin
Bucket myBucket = new Bucket(this, "myBucket");
IOrigin s3Origin = S3BucketOrigin.withOriginAccessControl(myBucket, S3BucketOriginWithOACProps.builder()
.originAccessLevels(List.of(AccessLevel.READ, AccessLevel.LIST))
.build());
// Create the Distribution construct
Distribution myMultiTenantDistribution = Distribution.Builder.create(this, "cf-hosted-distribution")
.defaultBehavior(BehaviorOptions.builder()
.origin(s3Origin)
.build())
.defaultRootObject("index.html")
.build();
// Access the underlying L1 CfnDistribution to configure SaaS Manager properties which are not yet available in the L2 Distribution construct
CfnDistribution cfnDistribution = (CfnDistribution)myMultiTenantDistribution.getNode().getDefaultChild();
DefaultCacheBehaviorProperty defaultCacheBehavior = DefaultCacheBehaviorProperty.builder()
.targetOriginId(myBucket.getBucketArn())
.viewerProtocolPolicy("allow-all")
.compress(false)
.allowedMethods(List.of("GET", "HEAD"))
.cachePolicyId(CachePolicy.CACHING_OPTIMIZED.getCachePolicyId())
.build();
// Create the updated distributionConfig
DistributionConfigProperty distributionConfig = DistributionConfigProperty.builder()
.defaultCacheBehavior(defaultCacheBehavior)
.enabled(true)
// the properties below are optional
.connectionMode("tenant-only")
.origins(List.of(OriginProperty.builder()
.id(myBucket.getBucketArn())
.domainName(myBucket.getBucketDomainName())
.s3OriginConfig(S3OriginConfigProperty.builder().build())
.originPath("/{{tenantName}}")
.build()))
.tenantConfig(TenantConfigProperty.builder()
.parameterDefinitions(List.of(ParameterDefinitionProperty.builder()
.definition(DefinitionProperty.builder()
.stringSchema(StringSchemaProperty.builder()
.required(false)
// the properties below are optional
.comment("tenantName")
.defaultValue("root")
.build())
.build())
.name("tenantName")
.build()))
.build())
.build();
// Override the distribution configuration to enable multi-tenancy.
cfnDistribution.getDistributionConfig() = distributionConfig;
// Create a connection group so we have access to the RoutingEndpoint associated with the tenant we are about to create
CfnConnectionGroup connectionGroup = CfnConnectionGroup.Builder.create(this, "self-hosted-connection-group")
.enabled(true)
.ipv6Enabled(true)
.name("self-hosted-connection-group")
.build();
// Export the RoutingEndpoint, skip this step if you'd prefer to fetch it from the CloudFront console or via Cloudfront.ListConnectionGroups API
// Export the RoutingEndpoint, skip this step if you'd prefer to fetch it from the CloudFront console or via Cloudfront.ListConnectionGroups API
CfnOutput.Builder.create(this, "RoutingEndpoint")
.value(connectionGroup.getAttrRoutingEndpoint())
.description("CloudFront Routing Endpoint to be added to my hosted zone CNAME records")
.build();
// Create a distribution tenant with a self-hosted domain.
CfnDistributionTenant selfHostedTenant = CfnDistributionTenant.Builder.create(this, "self-hosted-tenant")
.distributionId(myMultiTenantDistribution.getDistributionId())
.connectionGroupId(connectionGroup.getAttrId())
.name("self-hosted-tenant")
.domains(List.of("self-hosted-tenant.my.domain.com"))
.enabled(true)
.managedCertificateRequest(ManagedCertificateRequestProperty.builder()
.primaryDomainName("self-hosted-tenant.my.domain.com")
.validationTokenHost("self-hosted")
.build())
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnDistributionTenant.static interfaceThe Certificate Manager (ACM) certificate associated with your distribution.static interfaceCustomizations for the distribution tenant.static interfaceThe details about the domain result.static interfaceThe customizations that you specified for the distribution tenant for geographic restrictions.static interfaceAn object that represents the request for the Amazon CloudFront managed ACM certificate.static interfaceA list of parameter values to add to the resource.static interfaceThe AWS WAF web ACL customization specified for the distribution tenant.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.cloudfront.IDistributionTenantRef
IDistributionTenantRef.Jsii$Default, IDistributionTenantRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnDistributionTenant(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDistributionTenant(software.amazon.jsii.JsiiObjectRef objRef) CfnDistributionTenant(software.constructs.Construct scope, String id, CfnDistributionTenantProps props) Create a newAWS::CloudFront::DistributionTenant. -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Resource Name (ARN) of the distribution tenant.The date and time when the distribution tenant was created.The current version of the distribution tenant.The ID of the distribution tenant.The date and time when the distribution tenant was updated.The status of the distribution tenant.Tag Manager which manages the tags for this resource.The ID of the connection group for the distribution tenant.Customizations for the distribution tenant.The ID of the multi-tenant distribution.A reference to a DistributionTenant resource.The domains associated with the distribution tenant.Indicates whether the distribution tenant is in an enabled state.An object that represents the request for the Amazon CloudFront managed ACM certificate.getName()The name of the distribution tenant.A list of parameter values to add to the resource.getTags()A complex type that contains zero or moreTagelements.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetConnectionGroupId(String value) The ID of the connection group for the distribution tenant.voidsetCustomizations(IResolvable value) Customizations for the distribution tenant.voidCustomizations for the distribution tenant.voidsetDistributionId(String value) The ID of the multi-tenant distribution.voidsetDomains(List<String> value) The domains associated with the distribution tenant.voidsetEnabled(Boolean value) Indicates whether the distribution tenant is in an enabled state.voidsetEnabled(IResolvable value) Indicates whether the distribution tenant is in an enabled state.voidAn object that represents the request for the Amazon CloudFront managed ACM certificate.voidAn object that represents the request for the Amazon CloudFront managed ACM certificate.voidThe name of the distribution tenant.voidsetParameters(List<Object> value) A list of parameter values to add to the resource.voidsetParameters(IResolvable value) A list of parameter values to add to the resource.voidA complex type that contains zero or moreTagelements.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnDistributionTenant
protected CfnDistributionTenant(software.amazon.jsii.JsiiObjectRef objRef) -
CfnDistributionTenant
protected CfnDistributionTenant(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnDistributionTenant
@Stability(Stable) public CfnDistributionTenant(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnDistributionTenantProps props) Create a newAWS::CloudFront::DistributionTenant.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the distribution tenant. -
getAttrCreatedTime
The date and time when the distribution tenant was created. -
getAttrDomainResults
-
getAttrETag
The current version of the distribution tenant. -
getAttrId
The ID of the distribution tenant. -
getAttrLastModifiedTime
The date and time when the distribution tenant was updated. -
getAttrStatus
The status of the distribution tenant. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getDistributionTenantRef
A reference to a DistributionTenant resource.- Specified by:
getDistributionTenantRefin interfaceIDistributionTenantRef
-
getDistributionId
The ID of the multi-tenant distribution. -
setDistributionId
The ID of the multi-tenant distribution. -
getDomains
The domains associated with the distribution tenant. -
setDomains
The domains associated with the distribution tenant. -
getName
The name of the distribution tenant. -
setName
The name of the distribution tenant. -
getConnectionGroupId
The ID of the connection group for the distribution tenant. -
setConnectionGroupId
The ID of the connection group for the distribution tenant. -
getCustomizations
Customizations for the distribution tenant.Returns union: either
IResolvableorCfnDistributionTenant.CustomizationsProperty -
setCustomizations
Customizations for the distribution tenant. -
setCustomizations
@Stability(Stable) public void setCustomizations(@Nullable CfnDistributionTenant.CustomizationsProperty value) Customizations for the distribution tenant. -
getEnabled
Indicates whether the distribution tenant is in an enabled state.Returns union: either
BooleanorIResolvable -
setEnabled
Indicates whether the distribution tenant is in an enabled state. -
setEnabled
Indicates whether the distribution tenant is in an enabled state. -
getManagedCertificateRequest
An object that represents the request for the Amazon CloudFront managed ACM certificate.Returns union: either
IResolvableorCfnDistributionTenant.ManagedCertificateRequestProperty -
setManagedCertificateRequest
An object that represents the request for the Amazon CloudFront managed ACM certificate. -
setManagedCertificateRequest
@Stability(Stable) public void setManagedCertificateRequest(@Nullable CfnDistributionTenant.ManagedCertificateRequestProperty value) An object that represents the request for the Amazon CloudFront managed ACM certificate. -
getParameters
A list of parameter values to add to the resource.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnDistributionTenant.ParameterProperty> -
setParameters
A list of parameter values to add to the resource. -
setParameters
A list of parameter values to add to the resource. -
getTags
A complex type that contains zero or moreTagelements. -
setTags
A complex type that contains zero or moreTagelements.
-