Deletes a certificate and its associated private key. If this action succeeds, the certificate is not available for use by Amazon Web Services services integrated with ACM. Deleting a certificate is eventually consistent. The may be a short delay before the certificate no longer appears in the list that can be displayed by calling the ListCertificates action or be retrieved by calling the GetCertificate action.
You cannot delete an ACM certificate that is being used by another Amazon Web Services service. To delete a certificate that is in use, you must first remove the certificate association using the console or the CLI for the associated service.
Deleting a certificate issued by a private certificate authority (CA) has no effect on the CA. You will continue to be charged for the CA until it is deleted. For more information, see Deleting Your Private CA in the Private Certificate Authority User Guide.
You cannot delete a certificate with a CertificateKeyPairOrigin of ACME. ACM automatically deletes these certificates 1 year after they expire.
Deleting a certificate issued by a private certificate authority (CA) has no effect on the CA. You will continue to be charged for the CA until it is deleted. For more information, see Deleting your private CA in the Amazon Web Services Private Certificate Authority User Guide.
Parameters:
-
certificate_arn
(Arn)
–
String that contains the ARN of the ACM certificate to be deleted. This must be of the form:
arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012
For more information about ARNs, see Amazon Resource Names (ARNs).
Raises:
-
AccessDeniedException
–
You do not have access required to perform this action.
-
ConflictException
–
You are trying to update a resource or configuration that is already being created or updated. Wait for the previous operation to finish and try again.
-
InvalidArnException
–
The requested Amazon Resource Name (ARN) does not refer to an existing resource.
-
ResourceInUseException
–
The certificate is in use by another Amazon Web Services service in the caller's account. Remove the association and try again.
-
ResourceNotFoundException
–
The specified certificate cannot be found in the caller's account or the caller's account cannot be found.
-
ThrottlingException
–
The request was denied because it exceeded a quota.
-
ValidationException
–
The supplied input failed to satisfy constraints of an Amazon Web Services service.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_acm/_services/acm.py
| def delete_certificate(
self,
certificate_arn: "capo_acm.types.arn.Arn",
*,
config_overrides: Optional[ACMClientConfig] = None,
) -> None:
"""<p>Deletes a certificate and its associated private key. If this action succeeds, the certificate is not available for use by Amazon Web Services services integrated with ACM. Deleting a certificate is eventually consistent. The may be a short delay before the certificate no longer appears in the list that can be displayed by calling the <a>ListCertificates</a> action or be retrieved by calling the <a>GetCertificate</a> action.</p> <note> <p>You cannot delete an ACM certificate that is being used by another Amazon Web Services service. To delete a certificate that is in use, you must first remove the certificate association using the console or the CLI for the associated service.</p> <p>Deleting a certificate issued by a private certificate authority (CA) has no effect on the CA. You will continue to be charged for the CA until it is deleted. For more information, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/PCADeleteCA.html"> Deleting Your Private CA</a> in the <i>Private Certificate Authority User Guide</i>.</p> <p>You cannot delete a certificate with a <code>CertificateKeyPairOrigin</code> of <code>ACME</code>. ACM automatically deletes these certificates 1 year after they expire.</p> </note> <p>Deleting a certificate issued by a private certificate authority (CA) has no effect on the CA. You will continue to be charged for the CA until it is deleted. For more information, see <a href="https://docs.aws.amazon.com/privateca/latest/userguide/PCADeleteCA.html">Deleting your private CA</a> in the <i>Amazon Web Services Private Certificate Authority User Guide</i>.</p>
Args:
certificate_arn: <p>String that contains the ARN of the ACM certificate to be deleted. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
Raises:
capo_acm.errors.access_denied_exception.AccessDeniedException: <p>You do not have access required to perform this action.</p>
capo_acm.errors.conflict_exception.ConflictException: <p>You are trying to update a resource or configuration that is already being created or updated. Wait for the previous operation to finish and try again.</p>
capo_acm.errors.invalid_arn_exception.InvalidArnException: <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
capo_acm.errors.resource_in_use_exception.ResourceInUseException: <p>The certificate is in use by another Amazon Web Services service in the caller's account. Remove the association and try again.</p>
capo_acm.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
capo_acm.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a quota.</p>
capo_acm.errors.validation_exception.ValidationException: <p>The supplied input failed to satisfy constraints of an Amazon Web Services service.</p>
capo_acm.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_acm.types.delete_certificate_request.DeleteCertificateRequest]",
) -> OperationResponse[None]:
import capo_acm._operations.certificate_manager.delete_certificate
output, http_response = (
capo_acm._operations.certificate_manager.delete_certificate.delete_certificate(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteCertificate")
)
input_: capo_acm.types.delete_certificate_request.DeleteCertificateRequest = {
"certificate_arn": certificate_arn
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|