Class MultitenantDistribution


  • public class MultitenantDistribution
    extends com.pulumi.resources.CustomResource
    Creates an Amazon CloudFront multi-tenant distribution. Multi-tenant distributions are a specialized type of CloudFront distribution designed for multi-tenant applications. They have specific limitations and requirements compared to standard CloudFront distributions. For information about CloudFront multi-tenant distributions, see the [Amazon CloudFront Developer Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/). ## Example Usage ### Multi-tenant Distribution Limitations Multi-tenant distributions have the following limitations compared to standard CloudFront distributions: - **Connection Mode**: Automatically set to `tenant-only` and cannot be modified - **Cache Policies**: Must use cache policies instead of legacy TTL settings - **Trusted Key Groups**: Must use trusted key groups instead of trusted signers - **WAF Integration**: Only supports WAF v2 web ACLs - **Certificate Management**: Must use ACM certificates (IAM certificates not supported) ### Unsupported Attributes The following attributes that are available in standard CloudFront distributions are **not supported** for multi-tenant distributions: - `activeTrustedSigners` - Use `activeTrustedKeyGroups` instead - `aliasIcpRecordals` - Managed by connection groups - `aliases` - Managed by connection groups - `anycastIpListId` - Use connection groups instead - `continuousDeploymentPolicyId` - `forwardedValues` in cache behaviors - Deprecated, use cache policies instead - `isIpv6Enabled` - Managed by connection groups - `priceClass` - Managed by connection groups - `smoothStreaming` in cache behaviors - `staging` mode - `trustedSigners` in cache behaviors - Use `trustedKeyGroups` instead - Cache behavior TTL settings (`defaultTtl`, `maxTtl`, `minTtl`) - Use cache policies instead
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudfront.MultitenantDistribution;
     import com.pulumi.aws.cloudfront.MultitenantDistributionArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionDefaultCacheBehaviorArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionDefaultCacheBehaviorAllowedMethodsArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionRestrictionsArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionRestrictionsGeoRestrictionArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionViewerCertificateArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionTenantConfigArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionTenantConfigParameterDefinitionArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionTenantConfigParameterDefinitionDefinitionArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionTenantConfigParameterDefinitionDefinitionStringSchemaArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionOriginArgs;
     import com.pulumi.aws.cloudfront.inputs.MultitenantDistributionOriginCustomOriginConfigArgs;
     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 MultitenantDistribution("example", MultitenantDistributionArgs.builder()
                 .defaultCacheBehavior(MultitenantDistributionDefaultCacheBehaviorArgs.builder()
                     .allowedMethods(MultitenantDistributionDefaultCacheBehaviorAllowedMethodsArgs.builder()
                         .items(                    
                             "DELETE",
                             "GET",
                             "HEAD",
                             "OPTIONS",
                             "PATCH",
                             "POST",
                             "PUT")
                         .cachedMethods(                    
                             "GET",
                             "HEAD")
                         .build())
                     .targetOriginId("example-origin")
                     .viewerProtocolPolicy("redirect-to-https")
                     .cachePolicyId(exampleAwsCloudfrontCachePolicy.id())
                     .build())
                 .restrictions(MultitenantDistributionRestrictionsArgs.builder()
                     .geoRestriction(MultitenantDistributionRestrictionsGeoRestrictionArgs.builder()
                         .restrictionType("none")
                         .build())
                     .build())
                 .viewerCertificate(MultitenantDistributionViewerCertificateArgs.builder()
                     .acmCertificateArn(exampleAwsAcmCertificate.arn())
                     .sslSupportMethod("sni-only")
                     .build())
                 .tenantConfig(MultitenantDistributionTenantConfigArgs.builder()
                     .parameterDefinitions(MultitenantDistributionTenantConfigParameterDefinitionArgs.builder()
                         .definitions(MultitenantDistributionTenantConfigParameterDefinitionDefinitionArgs.builder()
                             .stringSchemas(MultitenantDistributionTenantConfigParameterDefinitionDefinitionStringSchemaArgs.builder()
                                 .required(true)
                                 .comment("Origin domain parameter for tenants")
                                 .build())
                             .build())
                         .name("origin_domain")
                         .build())
                     .build())
                 .origins(MultitenantDistributionOriginArgs.builder()
                     .customOriginConfigs(MultitenantDistributionOriginCustomOriginConfigArgs.builder()
                         .httpPort(80)
                         .httpsPort(443)
                         .originProtocolPolicy("https-only")
                         .originSslProtocols("TLSv1.2")
                         .build())
                     .domainName("example.com")
                     .id("example-origin")
                     .build())
                 .comment("Multi-tenant distribution for my application")
                 .enabled(true)
                 .tags(Map.of("Environment", "production"))
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import CloudFront Multi-tenant Distributions using the `id`. For example: ```sh $ pulumi import aws:cloudfront/multitenantDistribution:MultitenantDistribution distribution E74FTE3AEXAMPLE ```
    • Constructor Detail

      • MultitenantDistribution

        public MultitenantDistribution​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • MultitenantDistribution

        public MultitenantDistribution​(java.lang.String name,
                                       MultitenantDistributionArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • MultitenantDistribution

        public MultitenantDistribution​(java.lang.String name,
                                       MultitenantDistributionArgs args,
                                       @Nullable
                                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • activeTrustedKeyGroups

        public com.pulumi.core.Output<java.util.Optional<java.util.List<MultitenantDistributionActiveTrustedKeyGroup>>> activeTrustedKeyGroups()
        Returns:
        List of key groups that CloudFront can use to validate signed URLs or signed cookies. See Active Trusted Key Groups below.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN for the distribution.
      • cacheBehaviors

        public com.pulumi.core.Output<java.util.Optional<java.util.List<MultitenantDistributionCacheBehavior>>> cacheBehaviors()
        Returns:
        Ordered list of cache behaviors resource for this distribution. See Cache Behavior below.
      • callerReference

        public com.pulumi.core.Output<java.lang.String> callerReference()
        Returns:
        Internal value used by CloudFront to allow future updates to the distribution configuration.
      • comment

        public com.pulumi.core.Output<java.lang.String> comment()
        Returns:
        Any comments you want to include about the distribution.
      • connectionMode

        public com.pulumi.core.Output<java.lang.String> connectionMode()
        Returns:
        Connection mode for the distribution. Always set to `tenant-only` for multi-tenant distributions.
      • customErrorResponses

        public com.pulumi.core.Output<java.util.Optional<java.util.List<MultitenantDistributionCustomErrorResponse>>> customErrorResponses()
        Returns:
        One or more custom error response elements. See Custom Error Response below.
      • defaultRootObject

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> defaultRootObject()
        Returns:
        Object that you want CloudFront to return when an end user requests the root URL.
      • domainName

        public com.pulumi.core.Output<java.lang.String> domainName()
        Returns:
        Domain name corresponding to the distribution.
      • enabled

        public com.pulumi.core.Output<java.lang.Boolean> enabled()
        Returns:
        Whether the distribution is enabled to accept end user requests for content.
      • etag

        public com.pulumi.core.Output<java.lang.String> etag()
        Returns:
        Current version of the distribution's information.
      • httpVersion

        public com.pulumi.core.Output<java.lang.String> httpVersion()
        Returns:
        Maximum HTTP version to support on the distribution. Allowed values are `http1.1`, `http2`, `http2and3`, and `http3`. Default: `http2`.
      • inProgressInvalidationBatches

        public com.pulumi.core.Output<java.lang.Integer> inProgressInvalidationBatches()
        Returns:
        Number of invalidation batches currently in progress.
      • lastModifiedTime

        public com.pulumi.core.Output<java.lang.String> lastModifiedTime()
        Returns:
        Date and time the distribution was last modified.
      • originGroups

        public com.pulumi.core.Output<java.util.Optional<java.util.List<MultitenantDistributionOriginGroup>>> originGroups()
        Returns:
        One or more originGroup for this distribution (multiples allowed). See Origin Group below.
      • origins

        public com.pulumi.core.Output<java.util.Optional<java.util.List<MultitenantDistributionOrigin>>> origins()
        Returns:
        One or more origins for this distribution (multiples allowed). See Origin below.
      • restrictions

        public com.pulumi.core.Output<java.util.Optional<MultitenantDistributionRestrictions>> restrictions()
        Returns:
        Restriction configuration for this distribution. See Restrictions below.
      • status

        public com.pulumi.core.Output<java.lang.String> status()
        Returns:
        Current status of the distribution. `Deployed` if the distribution's information is fully propagated throughout the Amazon CloudFront system.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • tenantConfig

        public com.pulumi.core.Output<MultitenantDistributionTenantConfig> tenantConfig()
        Returns:
        Tenant configuration that contains parameter definitions for multi-tenant distributions. See Tenant Config below.
      • webAclId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> webAclId()
        Returns:
        Unique identifier that specifies the AWS WAF v2 web ACL to associate with this distribution.
      • get

        public static MultitenantDistribution get​(java.lang.String name,
                                                  com.pulumi.core.Output<java.lang.String> id,
                                                  @Nullable
                                                  MultitenantDistributionState state,
                                                  @Nullable
                                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.