Skip to content

delete_policy async

delete_policy(
    resource_arn: Arn, *, config_overrides: Optional[AsyncACMPCAClientConfig] = None
) -> None

Deletes the resource-based policy attached to a private CA. Deletion will remove any access that the policy has granted. If there is no policy attached to the private CA, this action will return successful.

If you delete a policy that was applied through Amazon Web Services Resource Access Manager (RAM), the CA will be removed from all shares in which it was included.

The Certificate Manager Service Linked Role that the policy supports is not affected when you delete the policy.

The current policy can be shown with GetPolicy and updated with PutPolicy.

About Policies

  • A policy grants access on a private CA to an Amazon Web Services customer account, to Amazon Web Services Organizations, or to an Amazon Web Services Organizations unit. Policies are under the control of a CA administrator. For more information, see Using a Resource Based Policy with Amazon Web Services Private CA.

  • A policy permits a user of Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.

  • For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the Amazon Web Services Private CA policy. For more information, see Using a Service Linked Role with ACM.

  • Updates made in Amazon Web Services Resource Manager (RAM) are reflected in policies. For more information, see Attach a Policy for Cross-Account Access.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Number (ARN) of the private CA that will have its policy deleted. You can find the CA's ARN by calling the ListCertificateAuthorities action. The ARN value must have the form arn:aws:acm-pca:region:account:certificate-authority/01234567-89ab-cdef-0123-0123456789ab.

Raises:

  • ConcurrentModificationException –

    A previous update to your private CA is still ongoing.

  • InvalidArnException –

    The requested Amazon Resource Name (ARN) does not refer to an existing resource.

  • InvalidStateException –

    The state of the private CA does not allow this action to occur.

  • LockoutPreventedException –

    The current action was prevented because it would lock the caller out from performing subsequent actions. Verify that the specified parameters would not result in the caller being denied access to the resource.

  • RequestFailedException –

    The request has failed for an unspecified reason.

  • ResourceNotFoundException –

    A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.

  • UnknownServiceError –

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

Source code in docs_src/capo_acm_pca/_services/async_acmpca.py
async def delete_policy(
    self,
    resource_arn: "capo_acm_pca.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncACMPCAClientConfig] = None,
) -> None:
    """<p>Deletes the resource-based policy attached to a private CA. Deletion will remove any access that the policy has granted. If there is no policy attached to the private CA, this action will return successful.</p> <p>If you delete a policy that was applied through Amazon Web Services Resource Access Manager (RAM), the CA will be removed from all shares in which it was included. </p> <p>The Certificate Manager Service Linked Role that the policy supports is not affected when you delete the policy. </p> <p>The current policy can be shown with <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_GetPolicy.html">GetPolicy</a> and updated with <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_PutPolicy.html">PutPolicy</a>.</p> <p class="title"> <b>About Policies</b> </p> <ul> <li> <p>A policy grants access on a private CA to an Amazon Web Services customer account, to Amazon Web Services Organizations, or to an Amazon Web Services Organizations unit. Policies are under the control of a CA administrator. For more information, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with Amazon Web Services Private CA</a>.</p> </li> <li> <p>A policy permits a user of Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.</p> </li> <li> <p>For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the Amazon Web Services Private CA policy. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-slr.html">Using a Service Linked Role with ACM</a>.</p> </li> <li> <p>Updates made in Amazon Web Services Resource Manager (RAM) are reflected in policies. For more information, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> </li> </ul>

    Args:
        resource_arn: <p>The Amazon Resource Number (ARN) of the private CA that will have its policy deleted. You can find the CA's ARN by calling the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action. The ARN value must have the form <code>arn:aws:acm-pca:region:account:certificate-authority/01234567-89ab-cdef-0123-0123456789ab</code>. </p>

    Raises:
        capo_acm_pca.errors.concurrent_modification_exception.ConcurrentModificationException: <p>A previous update to your private CA is still ongoing.</p>
        capo_acm_pca.errors.invalid_arn_exception.InvalidArnException: <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
        capo_acm_pca.errors.invalid_state_exception.InvalidStateException: <p>The state of the private CA does not allow this action to occur.</p>
        capo_acm_pca.errors.lockout_prevented_exception.LockoutPreventedException: <p>The current action was prevented because it would lock the caller out from performing subsequent actions. Verify that the specified parameters would not result in the caller being denied access to the resource. </p>
        capo_acm_pca.errors.request_failed_exception.RequestFailedException: <p>The request has failed for an unspecified reason.</p>
        capo_acm_pca.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
        capo_acm_pca.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_acm_pca.types.delete_policy_request.DeletePolicyRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_acm_pca._operations.acm_private_ca.delete_policy

        (
            output,
            http_response,
        ) = await capo_acm_pca._operations.acm_private_ca.delete_policy.async_delete_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeletePolicy")
    )
    input_: capo_acm_pca.types.delete_policy_request.DeletePolicyRequest = {
        "resource_arn": resource_arn
    }

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