:doc:`CloudFront <../../cloudfront>` / Client / create_distribution_tenant

**************************
create_distribution_tenant
**************************



.. py:method:: CloudFront.Client.create_distribution_tenant(**kwargs)

  

  Creates a distribution tenant.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/CreateDistributionTenant>`_  


  **Request Syntax**
  ::

    response = client.create_distribution_tenant(
        DistributionId='string',
        Name='string',
        Domains=[
            {
                'Domain': 'string'
            },
        ],
        Tags={
            'Items': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
        Customizations={
            'WebAcl': {
                'Action': 'override'|'disable',
                'Arn': 'string'
            },
            'Certificate': {
                'Arn': 'string'
            },
            'GeoRestrictions': {
                'RestrictionType': 'blacklist'|'whitelist'|'none',
                'Locations': [
                    'string',
                ]
            }
        },
        Parameters=[
            {
                'Name': 'string',
                'Value': 'string'
            },
        ],
        ConnectionGroupId='string',
        ManagedCertificateRequest={
            'ValidationTokenHost': 'cloudfront'|'self-hosted',
            'PrimaryDomainName': 'string',
            'CertificateTransparencyLoggingPreference': 'enabled'|'disabled'
        },
        Enabled=True|False
    )
    
  :type DistributionId: string
  :param DistributionId: **[REQUIRED]** 

    The ID of the multi-tenant distribution to use for creating the distribution tenant.

    

  
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name of the distribution tenant. Enter a friendly identifier that is unique within your Amazon Web Services account. This name can't be updated after you create the distribution tenant.

    

  
  :type Domains: list
  :param Domains: **[REQUIRED]** 

    The domains associated with the distribution tenant. You must specify at least one domain in the request.

    

  
    - *(dict) --* 

      The domain for the specified distribution tenant.

      

    
      - **Domain** *(string) --* **[REQUIRED]** 

        The domain name.

        

      
    

  :type Tags: dict
  :param Tags: 

    A complex type that contains zero or more ``Tag`` elements.

    

  
    - **Items** *(list) --* 

      A complex type that contains ``Tag`` elements.

      

    
      - *(dict) --* 

        A complex type that contains ``Tag`` key and ``Tag`` value.

        

      
        - **Key** *(string) --* **[REQUIRED]** 

          A string that contains ``Tag`` key.

           

          The string length should be between 1 and 128 characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + @``.

          

        
        - **Value** *(string) --* 

          A string that contains an optional ``Tag`` value.

           

          The string length should be between 0 and 256 characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + @``.

          

        
      
  
  
  :type Customizations: dict
  :param Customizations: 

    Customizations for the distribution tenant. For each distribution tenant, you can specify the geographic restrictions, and the Amazon Resource Names (ARNs) for the ACM certificate and WAF web ACL. These are specific values that you can override or disable from the multi-tenant distribution that was used to create the distribution tenant.

    

  
    - **WebAcl** *(dict) --* 

      The WAF web ACL.

      

    
      - **Action** *(string) --* **[REQUIRED]** 

        The action for the WAF web ACL customization. You can specify ``override`` to specify a separate WAF web ACL for the distribution tenant. If you specify ``disable``, the distribution tenant won't have WAF web ACL protections and won't inherit from the multi-tenant distribution.

        

      
      - **Arn** *(string) --* 

        The Amazon Resource Name (ARN) of the WAF web ACL.

        

      
    
    - **Certificate** *(dict) --* 

      The Certificate Manager (ACM) certificate.

      

    
      - **Arn** *(string) --* **[REQUIRED]** 

        The Amazon Resource Name (ARN) of the ACM certificate.

        

      
    
    - **GeoRestrictions** *(dict) --* 

      The geographic restrictions.

      

    
      - **RestrictionType** *(string) --* **[REQUIRED]** 

        The method that you want to use to restrict distribution of your content by country:

         

        
        * ``none``: No geographic restriction is enabled, meaning access to content is not restricted by client geo location.
         
        * ``blacklist``: The ``Location`` elements specify the countries in which you don't want CloudFront to distribute your content.
         
        * ``whitelist``: The ``Location`` elements specify the countries in which you want CloudFront to distribute your content.
        

        

      
      - **Locations** *(list) --* 

        The locations for geographic restrictions.

        

      
        - *(string) --* 

        
    
    
  
  :type Parameters: list
  :param Parameters: 

    A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.

    

  
    - *(dict) --* 

      A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.

      

    
      - **Name** *(string) --* **[REQUIRED]** 

        The parameter name.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        The parameter value.

        

      
    

  :type ConnectionGroupId: string
  :param ConnectionGroupId: 

    The ID of the connection group to associate with the distribution tenant.

    

  
  :type ManagedCertificateRequest: dict
  :param ManagedCertificateRequest: 

    The configuration for the CloudFront managed ACM certificate request.

    

  
    - **ValidationTokenHost** *(string) --* **[REQUIRED]** 

      Specify how the HTTP validation token will be served when requesting the CloudFront managed ACM certificate.

       

      
      * For ``cloudfront``, CloudFront will automatically serve the validation token. Choose this mode if you can point the domain's DNS to CloudFront immediately.
       
      * For ``self-hosted``, you serve the validation token from your existing infrastructure. Choose this mode when you need to maintain current traffic flow while your certificate is being issued. You can place the validation token at the well-known path on your existing web server, wait for ACM to validate and issue the certificate, and then update your DNS to point to CloudFront.
      

      

    
    - **PrimaryDomainName** *(string) --* 

      The primary domain name associated with the CloudFront managed ACM certificate.

      

    
    - **CertificateTransparencyLoggingPreference** *(string) --* 

      You can opt out of certificate transparency logging by specifying the ``disabled`` option. Opt in by specifying ``enabled``. For more information, see `Certificate Transparency Logging <https://docs.aws.amazon.com/acm/latest/userguide/acm-concepts.html#concept-transparency>`__ in the *Certificate Manager User Guide*.

      

    
  
  :type Enabled: boolean
  :param Enabled: 

    Indicates whether the distribution tenant should be enabled when created. If the distribution tenant is disabled, the distribution tenant won't serve traffic.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'DistributionTenant': {
              'Id': 'string',
              'DistributionId': 'string',
              'Name': 'string',
              'Arn': 'string',
              'Domains': [
                  {
                      'Domain': 'string',
                      'Status': 'active'|'inactive'
                  },
              ],
              'Tags': {
                  'Items': [
                      {
                          'Key': 'string',
                          'Value': 'string'
                      },
                  ]
              },
              'Customizations': {
                  'WebAcl': {
                      'Action': 'override'|'disable',
                      'Arn': 'string'
                  },
                  'Certificate': {
                      'Arn': 'string'
                  },
                  'GeoRestrictions': {
                      'RestrictionType': 'blacklist'|'whitelist'|'none',
                      'Locations': [
                          'string',
                      ]
                  }
              },
              'Parameters': [
                  {
                      'Name': 'string',
                      'Value': 'string'
                  },
              ],
              'ConnectionGroupId': 'string',
              'CreatedTime': datetime(2015, 1, 1),
              'LastModifiedTime': datetime(2015, 1, 1),
              'Enabled': True|False,
              'Status': 'string'
          },
          'ETag': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **DistributionTenant** *(dict) --* 

        The distribution tenant that you created.

        
        

        - **Id** *(string) --* 

          The ID of the distribution tenant.

          
        

        - **DistributionId** *(string) --* 

          The ID of the multi-tenant distribution.

          
        

        - **Name** *(string) --* 

          The name of the distribution tenant.

          
        

        - **Arn** *(string) --* 

          The Amazon Resource Name (ARN) of the distribution tenant.

          
        

        - **Domains** *(list) --* 

          The domains associated with the distribution tenant.

          
          

          - *(dict) --* 

            The details about the domain result.

            
            

            - **Domain** *(string) --* 

              The specified domain.

              
            

            - **Status** *(string) --* 

              Whether the domain is active or inactive.

              
        
      
        

        - **Tags** *(dict) --* 

          A complex type that contains zero or more ``Tag`` elements.

          
          

          - **Items** *(list) --* 

            A complex type that contains ``Tag`` elements.

            
            

            - *(dict) --* 

              A complex type that contains ``Tag`` key and ``Tag`` value.

              
              

              - **Key** *(string) --* 

                A string that contains ``Tag`` key.

                 

                The string length should be between 1 and 128 characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + @``.

                
              

              - **Value** *(string) --* 

                A string that contains an optional ``Tag`` value.

                 

                The string length should be between 0 and 256 characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + @``.

                
          
        
      
        

        - **Customizations** *(dict) --* 

          Customizations for the distribution tenant. For each distribution tenant, you can specify the geographic restrictions, and the Amazon Resource Names (ARNs) for the ACM certificate and WAF web ACL. These are specific values that you can override or disable from the multi-tenant distribution that was used to create the distribution tenant.

          
          

          - **WebAcl** *(dict) --* 

            The WAF web ACL.

            
            

            - **Action** *(string) --* 

              The action for the WAF web ACL customization. You can specify ``override`` to specify a separate WAF web ACL for the distribution tenant. If you specify ``disable``, the distribution tenant won't have WAF web ACL protections and won't inherit from the multi-tenant distribution.

              
            

            - **Arn** *(string) --* 

              The Amazon Resource Name (ARN) of the WAF web ACL.

              
        
          

          - **Certificate** *(dict) --* 

            The Certificate Manager (ACM) certificate.

            
            

            - **Arn** *(string) --* 

              The Amazon Resource Name (ARN) of the ACM certificate.

              
        
          

          - **GeoRestrictions** *(dict) --* 

            The geographic restrictions.

            
            

            - **RestrictionType** *(string) --* 

              The method that you want to use to restrict distribution of your content by country:

               

              
              * ``none``: No geographic restriction is enabled, meaning access to content is not restricted by client geo location.
               
              * ``blacklist``: The ``Location`` elements specify the countries in which you don't want CloudFront to distribute your content.
               
              * ``whitelist``: The ``Location`` elements specify the countries in which you want CloudFront to distribute your content.
              

              
            

            - **Locations** *(list) --* 

              The locations for geographic restrictions.

              
              

              - *(string) --* 
          
        
      
        

        - **Parameters** *(list) --* 

          A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.

          
          

          - *(dict) --* 

            A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.

            
            

            - **Name** *(string) --* 

              The parameter name.

              
            

            - **Value** *(string) --* 

              The parameter value.

              
        
      
        

        - **ConnectionGroupId** *(string) --* 

          The ID of the connection group for the distribution tenant. If you don't specify a connection group, CloudFront uses the default connection group.

          
        

        - **CreatedTime** *(datetime) --* 

          The date and time when the distribution tenant was created.

          
        

        - **LastModifiedTime** *(datetime) --* 

          The date and time when the distribution tenant was updated.

          
        

        - **Enabled** *(boolean) --* 

          Indicates whether the distribution tenant is in an enabled state. If disabled, the distribution tenant won't serve traffic.

          
        

        - **Status** *(string) --* 

          The status of the distribution tenant.

          
    
      

      - **ETag** *(string) --* 

        The current version of the distribution tenant.

        
  
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.AccessDenied`

  
  *   :py:class:`CloudFront.Client.exceptions.EntityNotFound`

  
  *   :py:class:`CloudFront.Client.exceptions.EntityAlreadyExists`

  
  *   :py:class:`CloudFront.Client.exceptions.CNAMEAlreadyExists`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidTagging`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidAssociation`

  
  *   :py:class:`CloudFront.Client.exceptions.EntityLimitExceeded`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidArgument`

  