Skip to content

create_distribution_tenant

create_distribution_tenant(
    distribution_id: string,
    name: string,
    domains: DomainList,
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
    tags: Optional[Tags] = None,
    customizations: Optional[Customizations] = None,
    parameters: Optional[Parameters] = None,
    connection_group_id: Optional[string] = None,
    managed_certificate_request: Optional[ManagedCertificateRequest] = None,
    enabled: Optional[boolean] = None,
) -> CreateDistributionTenantResult

Creates a distribution tenant.

Parameters:

  • distribution_id (string) –

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

  • name (string) –

    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.

  • domains (DomainList) –

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

  • customizations (Optional[Customizations], default: None ) –

    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.

  • parameters (Optional[Parameters], default: None ) –

    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.

  • connection_group_id (Optional[string], default: None ) –

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

  • managed_certificate_request (Optional[ManagedCertificateRequest], default: None ) –

    The configuration for the CloudFront managed ACM certificate request.

  • enabled (Optional[boolean], default: None ) –

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

Raises:

Source code in docs_src/capo_cloudfront/_services/cloud_front.py
def create_distribution_tenant(
    self,
    distribution_id: "capo_cloudfront.types.string.string",
    name: "capo_cloudfront.types.string.string",
    domains: "capo_cloudfront.types.domain_list.DomainList",
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
    tags: Optional["capo_cloudfront.types.tags.Tags"] = None,
    customizations: Optional[
        "capo_cloudfront.types.customizations.Customizations"
    ] = None,
    parameters: Optional["capo_cloudfront.types.parameters.Parameters"] = None,
    connection_group_id: Optional["capo_cloudfront.types.string.string"] = None,
    managed_certificate_request: Optional[
        "capo_cloudfront.types.managed_certificate_request.ManagedCertificateRequest"
    ] = None,
    enabled: Optional["capo_cloudfront.types.boolean.boolean"] = None,
) -> "capo_cloudfront.types.create_distribution_tenant_result.CreateDistributionTenantResult":
    """<p>Creates a distribution tenant.</p>

    Args:
        distribution_id: <p>The ID of the multi-tenant distribution to use for creating the distribution tenant.</p>
        name: <p>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.</p>
        domains: <p>The domains associated with the distribution tenant. You must specify at least one domain in the request.</p>
        customizations: <p>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.</p>
        parameters: <p>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.</p>
        connection_group_id: <p>The ID of the connection group to associate with the distribution tenant.</p>
        managed_certificate_request: <p>The configuration for the CloudFront managed ACM certificate request.</p>
        enabled: <p>Indicates whether the distribution tenant should be enabled when created. If the distribution tenant is disabled, the distribution tenant won't serve traffic.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.cname_already_exists.CNAMEAlreadyExists: <p>The CNAME specified is already defined for CloudFront.</p>
        capo_cloudfront.errors.entity_already_exists.EntityAlreadyExists: <p>The entity already exists. You must provide a unique entity.</p>
        capo_cloudfront.errors.entity_limit_exceeded.EntityLimitExceeded: <p>The entity limit has been exceeded.</p>
        capo_cloudfront.errors.entity_not_found.EntityNotFound: <p>The entity was not found.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.invalid_association.InvalidAssociation: <p>The specified CloudFront resource can't be associated.</p>
        capo_cloudfront.errors.invalid_tagging.InvalidTagging: <p>The tagging specified is not valid.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudfront.types.create_distribution_tenant_request.CreateDistributionTenantRequest]",
    ) -> OperationResponse[
        "capo_cloudfront.types.create_distribution_tenant_result.CreateDistributionTenantResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.create_distribution_tenant

        output, http_response = (
            capo_cloudfront._operations.cloudfront2020_05_31.create_distribution_tenant.create_distribution_tenant(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDistributionTenant")
    )
    input_: capo_cloudfront.types.create_distribution_tenant_request.CreateDistributionTenantRequest = {
        "distribution_id": distribution_id,
        "name": name,
        "domains": domains,
    }
    if tags is not None:
        input_["tags"] = tags
    if customizations is not None:
        input_["customizations"] = customizations
    if parameters is not None:
        input_["parameters"] = parameters
    if connection_group_id is not None:
        input_["connection_group_id"] = connection_group_id
    if managed_certificate_request is not None:
        input_["managed_certificate_request"] = managed_certificate_request
    if enabled is not None:
        input_["enabled"] = enabled

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output