delete_certificate

delete_certificate(**kwargs)

Deletes the specified certificate.

A certificate cannot be deleted if it has a policy or IoT thing attached to it or if its status is set to ACTIVE. To delete a certificate, first use the DetachPolicy action to detach all policies. Next, use the UpdateCertificate action to set the certificate to the INACTIVE status.

Requires permission to access the DeleteCertificate action.

See also: AWS API Documentation

Request Syntax

response = client.delete_certificate(
    certificateId='string',
    forceDelete=True|False
)
Parameters
  • certificateId (string) --

    [REQUIRED]

    The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)

  • forceDelete (boolean) -- Forces the deletion of a certificate if it is inactive and is not attached to an IoT thing.
Returns

None

Exceptions

  • IoT.Client.exceptions.CertificateStateException
  • IoT.Client.exceptions.DeleteConflictException
  • IoT.Client.exceptions.InvalidRequestException
  • IoT.Client.exceptions.ThrottlingException
  • IoT.Client.exceptions.UnauthorizedException
  • IoT.Client.exceptions.ServiceUnavailableException
  • IoT.Client.exceptions.InternalFailureException
  • IoT.Client.exceptions.ResourceNotFoundException