Skip to content

update_template async

update_template(
    template_arn: TemplateArn,
    *,
    config_overrides: Optional[AsyncPcaConnectorAdClientConfig] = None,
    definition: Optional[TemplateDefinition] = None,
    reenroll_all_certificate_holders: Optional[bool] = None,
) -> None

Update template configuration to define the information included in certificates.

Parameters:

  • template_arn (TemplateArn) –

    The Amazon Resource Name (ARN) that was returned when you called CreateTemplate.

  • definition (Optional[TemplateDefinition], default: None ) –

    Template configuration to define the information included in certificates. Define certificate validity and renewal periods, certificate request handling and enrollment options, key usage extensions, application policies, and cryptography settings.

  • reenroll_all_certificate_holders (Optional[bool], default: None ) –

    This setting allows the major version of a template to be increased automatically. All members of Active Directory groups that are allowed to enroll with a template will receive a new certificate issued using that template.

Raises:

  • AccessDeniedException –

    You can receive this error if you attempt to create a resource share when you don't have the required permissions. This can be caused by insufficient permissions in policies attached to your Amazon Web Services Identity and Access Management (IAM) principal. It can also happen because of restrictions in place from an Amazon Web Services Organizations service control policy (SCP) that affects your Amazon Web Services account.

  • ConflictException –

    This request cannot be completed for one of the following reasons because the requested resource was being concurrently modified by another request.

  • InternalServerException –

    The request processing has failed because of an unknown error, exception or failure with an internal server.

  • ResourceNotFoundException –

    The operation tried to access a nonexistent resource. The resource might not be specified correctly, or its status might not be ACTIVE.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • ValidationException –

    An input validation error occurred. For example, invalid characters in a template name, or if a pagination token is invalid.

  • UnknownServiceError –

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

Source code in docs_src/capo_pca_connector_ad/_services/async_pca_connector_ad.py
async def update_template(
    self,
    template_arn: "capo_pca_connector_ad.types.template_arn.TemplateArn",
    *,
    config_overrides: Optional[AsyncPcaConnectorAdClientConfig] = None,
    definition: Optional[
        "capo_pca_connector_ad.types.template_definition.TemplateDefinition"
    ] = None,
    reenroll_all_certificate_holders: Optional[bool] = None,
) -> None:
    """<p>Update template configuration to define the information included in certificates.</p>

    Args:
        template_arn: <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html">CreateTemplate</a>.</p>
        definition: <p>Template configuration to define the information included in certificates. Define certificate validity and renewal periods, certificate request handling and enrollment options, key usage extensions, application policies, and cryptography settings.</p>
        reenroll_all_certificate_holders: <p>This setting allows the major version of a template to be increased automatically. All members of Active Directory groups that are allowed to enroll with a template will receive a new certificate issued using that template.</p>

    Raises:
        capo_pca_connector_ad.errors.access_denied_exception.AccessDeniedException: <p>You can receive this error if you attempt to create a resource share when you don't have the required permissions. This can be caused by insufficient permissions in policies attached to your Amazon Web Services Identity and Access Management (IAM) principal. It can also happen because of restrictions in place from an Amazon Web Services Organizations service control policy (SCP) that affects your Amazon Web Services account. </p>
        capo_pca_connector_ad.errors.conflict_exception.ConflictException: <p>This request cannot be completed for one of the following reasons because the requested resource was being concurrently modified by another request.</p>
        capo_pca_connector_ad.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure with an internal server. </p>
        capo_pca_connector_ad.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent resource. The resource might not be specified correctly, or its status might not be ACTIVE.</p>
        capo_pca_connector_ad.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded. </p>
        capo_pca_connector_ad.errors.validation_exception.ValidationException: <p>An input validation error occurred. For example, invalid characters in a template name, or if a pagination token is invalid. </p>
        capo_pca_connector_ad.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pca_connector_ad.types.update_template_request.UpdateTemplateRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_pca_connector_ad._operations.pca_connector_ad.update_template

        (
            output,
            http_response,
        ) = await capo_pca_connector_ad._operations.pca_connector_ad.update_template.async_update_template(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTemplate")
    )
    input_: capo_pca_connector_ad.types.update_template_request.UpdateTemplateRequest = {
        "template_arn": template_arn
    }
    if definition is not None:
        input_["definition"] = definition
    if reenroll_all_certificate_holders is not None:
        input_["reenroll_all_certificate_holders"] = (
            reenroll_all_certificate_holders
        )

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