Skip to content

create_certificate_provider async

create_certificate_provider(
    certificate_provider_name: CertificateProviderName,
    lambda_function_arn: CertificateProviderFunctionArn,
    account_default_for_operations: CertificateProviderAccountDefaultForOperations,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagList] = None,
) -> CreateCertificateProviderResponse

Creates an Amazon Web Services IoT Core certificate provider. You can use Amazon Web Services IoT Core certificate provider to customize how to sign a certificate signing request (CSR) in IoT fleet provisioning. For more information, see Customizing certificate signing using Amazon Web Services IoT Core certificate provider from Amazon Web Services IoT Core Developer Guide.

Requires permission to access the CreateCertificateProvider action.

After you create a certificate provider, the behavior of CreateCertificateFromCsr API for fleet provisioning will change and all API calls to CreateCertificateFromCsr will invoke the certificate provider to create the certificates. It can take up to a few minutes for this behavior to change after a certificate provider is created.

Parameters:

  • certificate_provider_name (CertificateProviderName) –

    The name of the certificate provider.

  • lambda_function_arn (CertificateProviderFunctionArn) –

    The ARN of the Lambda function that defines the authentication logic.

  • account_default_for_operations (CertificateProviderAccountDefaultForOperations) –

    A list of the operations that the certificate provider will use to generate certificates. Valid value: CreateCertificateFromCsr.

  • client_token (Optional[ClientToken], default: None ) –

    A string that you can optionally pass in the CreateCertificateProvider request to make sure the request is idempotent.

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

    Metadata which can be used to manage the certificate provider.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def create_certificate_provider(
    self,
    certificate_provider_name: "capo_iot.types.certificate_provider_name.CertificateProviderName",
    lambda_function_arn: "capo_iot.types.certificate_provider_function_arn.CertificateProviderFunctionArn",
    account_default_for_operations: "capo_iot.types.certificate_provider_account_default_for_operations.CertificateProviderAccountDefaultForOperations",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    client_token: Optional["capo_iot.types.client_token.ClientToken"] = None,
    tags: Optional["capo_iot.types.tag_list.TagList"] = None,
) -> "capo_iot.types.create_certificate_provider_response.CreateCertificateProviderResponse":
    """<p>Creates an Amazon Web Services IoT Core certificate provider. You can use Amazon Web Services IoT Core certificate provider to customize how to sign a certificate signing request (CSR) in IoT fleet provisioning. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provisioning-cert-provider.html">Customizing certificate signing using Amazon Web Services IoT Core certificate provider</a> from <i>Amazon Web Services IoT Core Developer Guide</i>.</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">CreateCertificateProvider</a> action.</p> <important> <p>After you create a certificate provider, the behavior of <a href="https://docs.aws.amazon.com/iot/latest/developerguide/fleet-provision-api.html#create-cert-csr"> <code>CreateCertificateFromCsr</code> API for fleet provisioning</a> will change and all API calls to <code>CreateCertificateFromCsr</code> will invoke the certificate provider to create the certificates. It can take up to a few minutes for this behavior to change after a certificate provider is created.</p> </important>

    Args:
        certificate_provider_name: <p>The name of the certificate provider.</p>
        lambda_function_arn: <p>The ARN of the Lambda function that defines the authentication logic.</p>
        account_default_for_operations: <p>A list of the operations that the certificate provider will use to generate certificates. Valid value: <code>CreateCertificateFromCsr</code>.</p>
        client_token: <p>A string that you can optionally pass in the <code>CreateCertificateProvider</code> request to make sure the request is idempotent.</p>
        tags: <p>Metadata which can be used to manage the certificate provider.</p>

    Raises:
        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_certificate_provider_request.CreateCertificateProviderRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.create_certificate_provider_response.CreateCertificateProviderResponse"
    ]:
        import capo_iot._operations.aws_iot_service.create_certificate_provider

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCertificateProvider")
    )
    input_: capo_iot.types.create_certificate_provider_request.CreateCertificateProviderRequest = {
        "certificate_provider_name": certificate_provider_name,
        "lambda_function_arn": lambda_function_arn,
        "account_default_for_operations": account_default_for_operations,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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