Skip to content

create_domain_name

create_domain_name(
    domain_name: String,
    *,
    config_overrides: Optional[APIGatewayClientConfig] = None,
    certificate_name: Optional[String] = None,
    certificate_body: Optional[String] = None,
    certificate_private_key: Optional[String] = None,
    certificate_chain: Optional[String] = None,
    certificate_arn: Optional[String] = None,
    regional_certificate_name: Optional[String] = None,
    regional_certificate_arn: Optional[String] = None,
    endpoint_configuration: Optional[EndpointConfiguration] = None,
    tags: Optional[MapOfStringToString] = None,
    security_policy: Optional[SecurityPolicy] = None,
    endpoint_access_mode: Optional[EndpointAccessMode] = None,
    mutual_tls_authentication: Optional[MutualTlsAuthenticationInput] = None,
    ownership_verification_certificate_arn: Optional[String] = None,
    policy: Optional[String] = None,
    routing_mode: Optional[RoutingMode] = None,
) -> DomainName

Creates a new domain name.

Parameters:

  • domain_name (String) –

    The name of the DomainName resource.

  • certificate_name (Optional[String], default: None ) –

    The user-friendly name of the certificate that will be used by edge-optimized endpoint or private endpoint for this domain name.

  • certificate_body (Optional[String], default: None ) –

    [Deprecated] The body of the server certificate that will be used by edge-optimized endpoint or private endpoint for this domain name provided by your certificate authority.

  • certificate_private_key (Optional[String], default: None ) –

    [Deprecated] Your edge-optimized endpoint's domain name certificate's private key.

  • certificate_chain (Optional[String], default: None ) –

    [Deprecated] The intermediate certificates and optionally the root certificate, one after the other without any blank lines, used by an edge-optimized endpoint for this domain name. If you include the root certificate, your certificate chain must start with intermediate certificates and end with the root certificate. Use the intermediate certificates that were provided by your certificate authority. Do not include any intermediaries that are not in the chain of trust path.

  • certificate_arn (Optional[String], default: None ) –

    The reference to an Amazon Web Services-managed certificate that will be used by edge-optimized endpoint or private endpoint for this domain name. Certificate Manager is the only supported source.

  • regional_certificate_name (Optional[String], default: None ) –

    The user-friendly name of the certificate that will be used by regional endpoint for this domain name.

  • regional_certificate_arn (Optional[String], default: None ) –

    The reference to an Amazon Web Services-managed certificate that will be used by regional endpoint for this domain name. Certificate Manager is the only supported source.

  • endpoint_configuration (Optional[EndpointConfiguration], default: None ) –

    The endpoint configuration of this DomainName showing the endpoint types and IP address types of the domain name.

  • tags (Optional[MapOfStringToString], default: None ) –

    The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.

  • security_policy (Optional[SecurityPolicy], default: None ) –

    The Transport Layer Security (TLS) version + cipher suite for this DomainName.

  • endpoint_access_mode (Optional[EndpointAccessMode], default: None ) –

    The endpoint access mode of the DomainName. Only available for DomainNames that use security policies that start with SecurityPolicy_.

  • ownership_verification_certificate_arn (Optional[String], default: None ) –

    The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.

  • policy (Optional[String], default: None ) –

    A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.

  • routing_mode (Optional[RoutingMode], default: None ) –

    The routing mode for this domain name. The routing mode determines how API Gateway sends traffic from your custom domain name to your private APIs.

Raises:

  • BadRequestException –

    The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

  • ConflictException –

    The request configuration has conflicts. For details, see the accompanying error message.

  • LimitExceededException –

    The request exceeded the rate limit. Retry after the specified time period.

  • TooManyRequestsException –

    The request has reached its throttling limit. Retry after the specified time period.

  • UnauthorizedException –

    The request is denied because the caller has insufficient permissions.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_api_gateway/_services/api_gateway.py
def create_domain_name(
    self,
    domain_name: "capo_api_gateway.types.string.String",
    *,
    config_overrides: Optional[APIGatewayClientConfig] = None,
    certificate_name: Optional["capo_api_gateway.types.string.String"] = None,
    certificate_body: Optional["capo_api_gateway.types.string.String"] = None,
    certificate_private_key: Optional[
        "capo_api_gateway.types.string.String"
    ] = None,
    certificate_chain: Optional["capo_api_gateway.types.string.String"] = None,
    certificate_arn: Optional["capo_api_gateway.types.string.String"] = None,
    regional_certificate_name: Optional[
        "capo_api_gateway.types.string.String"
    ] = None,
    regional_certificate_arn: Optional[
        "capo_api_gateway.types.string.String"
    ] = None,
    endpoint_configuration: Optional[
        "capo_api_gateway.types.endpoint_configuration.EndpointConfiguration"
    ] = None,
    tags: Optional[
        "capo_api_gateway.types.map_of_string_to_string.MapOfStringToString"
    ] = None,
    security_policy: Optional[
        "capo_api_gateway.types.security_policy.SecurityPolicy"
    ] = None,
    endpoint_access_mode: Optional[
        "capo_api_gateway.types.endpoint_access_mode.EndpointAccessMode"
    ] = None,
    mutual_tls_authentication: Optional[
        "capo_api_gateway.types.mutual_tls_authentication_input.MutualTlsAuthenticationInput"
    ] = None,
    ownership_verification_certificate_arn: Optional[
        "capo_api_gateway.types.string.String"
    ] = None,
    policy: Optional["capo_api_gateway.types.string.String"] = None,
    routing_mode: Optional[
        "capo_api_gateway.types.routing_mode.RoutingMode"
    ] = None,
) -> "capo_api_gateway.types.domain_name.DomainName":
    """<p>Creates a new domain name.</p>

    Args:
        domain_name: <p>The name of the DomainName resource.</p>
        certificate_name: <p>The user-friendly name of the certificate that will be used by edge-optimized endpoint or private endpoint for this domain name.</p>
        certificate_body: <p>[Deprecated] The body of the server certificate that will be used by edge-optimized endpoint or private endpoint for this domain name provided by your certificate authority.</p>
        certificate_private_key: <p>[Deprecated] Your edge-optimized endpoint's domain name certificate's private key.</p>
        certificate_chain: <p>[Deprecated] The intermediate certificates and optionally the root certificate, one after the other without any blank lines, used by an edge-optimized endpoint for this domain name. If you include the root certificate, your certificate chain must start with intermediate certificates and end with the root certificate. Use the intermediate certificates that were provided by your certificate authority. Do not include any intermediaries that are not in the chain of trust path.</p>
        certificate_arn: <p>The reference to an Amazon Web Services-managed certificate that will be used by edge-optimized endpoint or private endpoint for this domain name. Certificate Manager is the only supported source.</p>
        regional_certificate_name: <p>The user-friendly name of the certificate that will be used by regional endpoint for this domain name.</p>
        regional_certificate_arn: <p>The reference to an Amazon Web Services-managed certificate that will be used by regional endpoint for this domain name. Certificate Manager is the only supported source.</p>
        endpoint_configuration: <p>The endpoint configuration of this DomainName showing the endpoint types and IP address types of the domain name. </p>
        tags: <p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>
        security_policy: <p>The Transport Layer Security (TLS) version + cipher suite for this DomainName.</p>
        endpoint_access_mode: <p> The endpoint access mode of the DomainName. Only available for DomainNames that use security policies that start with <code>SecurityPolicy_</code>. </p>
        ownership_verification_certificate_arn: <p>The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.</p>
        policy: <p>A stringified JSON policy document that applies to the <code>execute-api</code> service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.</p>
        routing_mode: <p> The routing mode for this domain name. The routing mode determines how API Gateway sends traffic from your custom domain name to your private APIs. </p>

    Raises:
        capo_api_gateway.errors.bad_request_exception.BadRequestException: <p>The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>
        capo_api_gateway.errors.conflict_exception.ConflictException: <p>The request configuration has conflicts. For details, see the accompanying error message.</p>
        capo_api_gateway.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded the rate limit. Retry after the specified time period.</p>
        capo_api_gateway.errors.too_many_requests_exception.TooManyRequestsException: <p>The request has reached its throttling limit. Retry after the specified time period.</p>
        capo_api_gateway.errors.unauthorized_exception.UnauthorizedException: <p>The request is denied because the caller has insufficient permissions.</p>
        capo_api_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_api_gateway.types.create_domain_name_request.CreateDomainNameRequest]",
    ) -> OperationResponse["capo_api_gateway.types.domain_name.DomainName"]:
        import capo_api_gateway._operations.backplane_control_service.create_domain_name

        output, http_response = (
            capo_api_gateway._operations.backplane_control_service.create_domain_name.create_domain_name(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomainName")
    )
    input_: capo_api_gateway.types.create_domain_name_request.CreateDomainNameRequest = {
        "domain_name": domain_name
    }
    if certificate_name is not None:
        input_["certificate_name"] = certificate_name
    if certificate_body is not None:
        input_["certificate_body"] = certificate_body
    if certificate_private_key is not None:
        input_["certificate_private_key"] = certificate_private_key
    if certificate_chain is not None:
        input_["certificate_chain"] = certificate_chain
    if certificate_arn is not None:
        input_["certificate_arn"] = certificate_arn
    if regional_certificate_name is not None:
        input_["regional_certificate_name"] = regional_certificate_name
    if regional_certificate_arn is not None:
        input_["regional_certificate_arn"] = regional_certificate_arn
    if endpoint_configuration is not None:
        input_["endpoint_configuration"] = endpoint_configuration
    if tags is not None:
        input_["tags"] = tags
    if security_policy is not None:
        input_["security_policy"] = security_policy
    if endpoint_access_mode is not None:
        input_["endpoint_access_mode"] = endpoint_access_mode
    if mutual_tls_authentication is not None:
        input_["mutual_tls_authentication"] = mutual_tls_authentication
    if ownership_verification_certificate_arn is not None:
        input_["ownership_verification_certificate_arn"] = (
            ownership_verification_certificate_arn
        )
    if policy is not None:
        input_["policy"] = policy
    if routing_mode is not None:
        input_["routing_mode"] = routing_mode

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