Class CfnDistributionTenant

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-08-06T18:14:33.818Z") @Stability(Stable) public class CfnDistributionTenant extends CfnResource implements IInspectable, 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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the distribution tenant.
    • getAttrCreatedTime

      @Stability(Stable) @NotNull public String getAttrCreatedTime()
      The date and time when the distribution tenant was created.
    • getAttrDomainResults

      @Stability(Stable) @NotNull public IResolvable getAttrDomainResults()
    • getAttrETag

      @Stability(Stable) @NotNull public String getAttrETag()
      The current version of the distribution tenant.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the distribution tenant.
    • getAttrLastModifiedTime

      @Stability(Stable) @NotNull public String getAttrLastModifiedTime()
      The date and time when the distribution tenant was updated.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The status of the distribution tenant.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getDistributionId

      @Stability(Stable) @NotNull public String getDistributionId()
      The ID of the multi-tenant distribution.
    • setDistributionId

      @Stability(Stable) public void setDistributionId(@NotNull String value)
      The ID of the multi-tenant distribution.
    • getDomains

      @Stability(Stable) @NotNull public List<String> getDomains()
      The domains associated with the distribution tenant.
    • setDomains

      @Stability(Stable) public void setDomains(@NotNull List<String> value)
      The domains associated with the distribution tenant.
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the distribution tenant.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the distribution tenant.
    • getConnectionGroupId

      @Stability(Stable) @Nullable public String getConnectionGroupId()
      The ID of the connection group for the distribution tenant.
    • setConnectionGroupId

      @Stability(Stable) public void setConnectionGroupId(@Nullable String value)
      The ID of the connection group for the distribution tenant.
    • getCustomizations

      @Stability(Stable) @Nullable public Object getCustomizations()
      Customizations for the distribution tenant.
    • setCustomizations

      @Stability(Stable) public void setCustomizations(@Nullable IResolvable value)
      Customizations for the distribution tenant.
    • setCustomizations

      @Stability(Stable) public void setCustomizations(@Nullable CfnDistributionTenant.CustomizationsProperty value)
      Customizations for the distribution tenant.
    • getEnabled

      @Stability(Stable) @Nullable public Object getEnabled()
      Indicates whether the distribution tenant is in an enabled state.
    • setEnabled

      @Stability(Stable) public void setEnabled(@Nullable Boolean value)
      Indicates whether the distribution tenant is in an enabled state.
    • setEnabled

      @Stability(Stable) public void setEnabled(@Nullable IResolvable value)
      Indicates whether the distribution tenant is in an enabled state.
    • getManagedCertificateRequest

      @Stability(Stable) @Nullable public Object getManagedCertificateRequest()
      An object that represents the request for the Amazon CloudFront managed ACM certificate.
    • setManagedCertificateRequest

      @Stability(Stable) public void setManagedCertificateRequest(@Nullable IResolvable value)
      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

      @Stability(Stable) @Nullable public Object getParameters()
      A list of parameter values to add to the resource.
    • setParameters

      @Stability(Stable) public void setParameters(@Nullable IResolvable value)
      A list of parameter values to add to the resource.
    • setParameters

      @Stability(Stable) public void setParameters(@Nullable List<Object> value)
      A list of parameter values to add to the resource.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      A complex type that contains zero or more Tag elements.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      A complex type that contains zero or more Tag elements.