Skip to content

create_domain_configuration async

create_domain_configuration(
    domain_configuration_name: DomainConfigurationName,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    domain_name: Optional[DomainName] = None,
    server_certificate_arns: Optional[ServerCertificateArns] = None,
    validation_certificate_arn: Optional[AcmCertificateArn] = None,
    authorizer_config: Optional[AuthorizerConfig] = None,
    service_type: Optional[ServiceType] = None,
    tags: Optional[TagList] = None,
    tls_config: Optional[TlsConfig] = None,
    server_certificate_config: Optional[ServerCertificateConfig] = None,
    authentication_type: Optional[AuthenticationType] = None,
    application_protocol: Optional[ApplicationProtocol] = None,
    client_certificate_config: Optional[ClientCertificateConfig] = None,
) -> CreateDomainConfigurationResponse

Creates a domain configuration.

Requires permission to access the CreateDomainConfiguration action.

Parameters:

  • domain_configuration_name (DomainConfigurationName) –

    The name of the domain configuration. This value must be unique to a region.

  • domain_name (Optional[DomainName], default: None ) –

    The name of the domain.

  • server_certificate_arns (Optional[ServerCertificateArns], default: None ) –

    The ARNs of the certificates that IoT passes to the device during the TLS handshake. Currently you can specify only one certificate ARN. This value is not required for Amazon Web Services-managed domains.

  • validation_certificate_arn (Optional[AcmCertificateArn], default: None ) –

    The certificate used to validate the server certificate and prove domain name ownership. This certificate must be signed by a public certificate authority. This value is not required for Amazon Web Services-managed domains.

  • authorizer_config (Optional[AuthorizerConfig], default: None ) –

    An object that specifies the authorization service for a domain.

  • service_type (Optional[ServiceType], default: None ) –

    The type of service delivered by the endpoint.

    Amazon Web Services IoT Core currently supports only the DATA service type.

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

    Metadata which can be used to manage the domain configuration.

    For URI Request parameters use format: ...key1=value1&key2=value2...

    For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."

    For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."

  • tls_config (Optional[TlsConfig], default: None ) –

    An object that specifies the TLS configuration for a domain.

  • server_certificate_config (Optional[ServerCertificateConfig], default: None ) –

    The server certificate configuration.

  • authentication_type (Optional[AuthenticationType], default: None ) –

    An enumerated string that specifies the authentication type.

    • CUSTOM_AUTH_X509 - Use custom authentication and authorization with additional details from the X.509 client certificate.

    • AWS_X509 - Use X.509 client certificates without custom authentication and authorization. For more information, see X.509 client certificates.

    • DEFAULT - Use a combination of port and Application Layer Protocol Negotiation (ALPN) to specify authentication type. For more information, see Device communication protocols.

  • application_protocol (Optional[ApplicationProtocol], default: None ) –

    An enumerated string that specifies the application-layer protocol.

    • SECURE_MQTT - MQTT over TLS.

    • MQTT_WSS - MQTT over WebSocket.

    • HTTPS - HTTP over TLS.

    • DEFAULT - Use a combination of port and Application Layer Protocol Negotiation (ALPN) to specify application_layer protocol. For more information, see Device communication protocols.

  • client_certificate_config (Optional[ClientCertificateConfig], default: None ) –

    An object that specifies the client certificate configuration for a domain.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def create_domain_configuration(
    self,
    domain_configuration_name: "capo_iot.types.domain_configuration_name.DomainConfigurationName",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    domain_name: Optional["capo_iot.types.domain_name.DomainName"] = None,
    server_certificate_arns: Optional[
        "capo_iot.types.server_certificate_arns.ServerCertificateArns"
    ] = None,
    validation_certificate_arn: Optional[
        "capo_iot.types.acm_certificate_arn.AcmCertificateArn"
    ] = None,
    authorizer_config: Optional[
        "capo_iot.types.authorizer_config.AuthorizerConfig"
    ] = None,
    service_type: Optional["capo_iot.types.service_type.ServiceType"] = None,
    tags: Optional["capo_iot.types.tag_list.TagList"] = None,
    tls_config: Optional["capo_iot.types.tls_config.TlsConfig"] = None,
    server_certificate_config: Optional[
        "capo_iot.types.server_certificate_config.ServerCertificateConfig"
    ] = None,
    authentication_type: Optional[
        "capo_iot.types.authentication_type.AuthenticationType"
    ] = None,
    application_protocol: Optional[
        "capo_iot.types.application_protocol.ApplicationProtocol"
    ] = None,
    client_certificate_config: Optional[
        "capo_iot.types.client_certificate_config.ClientCertificateConfig"
    ] = None,
) -> "capo_iot.types.create_domain_configuration_response.CreateDomainConfigurationResponse":
    """<p>Creates a domain configuration.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">CreateDomainConfiguration</a> action.</p>

    Args:
        domain_configuration_name: <p>The name of the domain configuration. This value must be unique to a region.</p>
        domain_name: <p>The name of the domain.</p>
        server_certificate_arns: <p>The ARNs of the certificates that IoT passes to the device during the TLS handshake. Currently you can specify only one certificate ARN. This value is not required for Amazon Web Services-managed domains.</p>
        validation_certificate_arn: <p>The certificate used to validate the server certificate and prove domain name ownership. This certificate must be signed by a public certificate authority. This value is not required for Amazon Web Services-managed domains.</p>
        authorizer_config: <p>An object that specifies the authorization service for a domain.</p>
        service_type: <p>The type of service delivered by the endpoint.</p> <note> <p>Amazon Web Services IoT Core currently supports only the <code>DATA</code> service type.</p> </note>
        tags: <p>Metadata which can be used to manage the domain configuration.</p> <note> <p>For URI Request parameters use format: ...key1=value1&key2=value2...</p> <p>For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."</p> <p>For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."</p> </note>
        tls_config: <p>An object that specifies the TLS configuration for a domain.</p>
        server_certificate_config: <p>The server certificate configuration.</p>
        authentication_type: <p>An enumerated string that specifies the authentication type.</p> <ul> <li> <p> <code>CUSTOM_AUTH_X509</code> - Use custom authentication and authorization with additional details from the X.509 client certificate.</p> </li> </ul> <ul> <li> <p> <code>CUSTOM_AUTH</code> - Use custom authentication and authorization. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html">Custom authentication and authorization</a>.</p> </li> </ul> <ul> <li> <p> <code>AWS_X509</code> - Use X.509 client certificates without custom authentication and authorization. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html">X.509 client certificates</a>.</p> </li> </ul> <ul> <li> <p> <code>AWS_SIGV4</code> - Use Amazon Web Services Signature Version 4. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html">IAM users, groups, and roles</a>.</p> </li> </ul> <ul> <li> <p> <code>DEFAULT</code> - Use a combination of port and Application Layer Protocol Negotiation (ALPN) to specify authentication type. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/protocols.html">Device communication protocols</a>.</p> </li> </ul>
        application_protocol: <p>An enumerated string that specifies the application-layer protocol.</p> <ul> <li> <p> <code>SECURE_MQTT</code> - MQTT over TLS.</p> </li> </ul> <ul> <li> <p> <code>MQTT_WSS</code> - MQTT over WebSocket.</p> </li> </ul> <ul> <li> <p> <code>HTTPS</code> - HTTP over TLS.</p> </li> </ul> <ul> <li> <p> <code>DEFAULT</code> - Use a combination of port and Application Layer Protocol Negotiation (ALPN) to specify application_layer protocol. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/protocols.html">Device communication protocols</a>.</p> </li> </ul>
        client_certificate_config: <p>An object that specifies the client certificate configuration for a domain.</p>

    Raises:
        capo_iot.errors.certificate_validation_exception.CertificateValidationException: <p>The certificate is invalid.</p>
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.limit_exceeded_exception.LimitExceededException: <p>A limit has been exceeded.</p>
        capo_iot.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The resource already exists.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.create_domain_configuration_request.CreateDomainConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.create_domain_configuration_response.CreateDomainConfigurationResponse"
    ]:
        import capo_iot._operations.aws_iot_service.create_domain_configuration

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.create_domain_configuration.async_create_domain_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomainConfiguration")
    )
    input_: capo_iot.types.create_domain_configuration_request.CreateDomainConfigurationRequest = {
        "domain_configuration_name": domain_configuration_name
    }
    if domain_name is not None:
        input_["domain_name"] = domain_name
    if server_certificate_arns is not None:
        input_["server_certificate_arns"] = server_certificate_arns
    if validation_certificate_arn is not None:
        input_["validation_certificate_arn"] = validation_certificate_arn
    if authorizer_config is not None:
        input_["authorizer_config"] = authorizer_config
    if service_type is not None:
        input_["service_type"] = service_type
    if tags is not None:
        input_["tags"] = tags
    if tls_config is not None:
        input_["tls_config"] = tls_config
    if server_certificate_config is not None:
        input_["server_certificate_config"] = server_certificate_config
    if authentication_type is not None:
        input_["authentication_type"] = authentication_type
    if application_protocol is not None:
        input_["application_protocol"] = application_protocol
    if client_certificate_config is not None:
        input_["client_certificate_config"] = client_certificate_config

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output