Skip to content

delete_signing_certificate

delete_signing_certificate(
    certificate_id: certificateIdType,
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional[existingUserNameType] = None,
) -> None

Deletes a signing certificate associated with the specified IAM user.

If you do not specify a user name, IAM determines the user name implicitly based on the Amazon Web Services access key ID signing the request. This operation works for access keys under the Amazon Web Services account. Consequently, you can use this operation to manage Amazon Web Services account root user credentials even if the Amazon Web Services account has no associated IAM users.

Parameters:

  • user_name (Optional[existingUserNameType], default: None ) –

    The name of the user the signing certificate belongs to.

    This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

  • certificate_id (certificateIdType) –

    The ID of the signing certificate to delete.

    The format of this parameter, as described by its regex pattern, is a string of characters that can be upper- or lower-cased letters or digits.

Raises:

  • ConcurrentModificationException –

    The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.

  • NoSuchEntityException –

    The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ServiceFailureException –

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

  • UnknownServiceError –

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

Examples:

To delete a signing certificate for an IAM user The following command deletes the specified signing certificate for the IAM user named Anika.

>>> client.delete_signing_certificate(user_name='Anika', certificate_id='TA7SMP42TDN5Z26OBPJE7EXAMPLE')
Source code in docs_src/capo_iam/_services/iam.py
def delete_signing_certificate(
    self,
    certificate_id: "capo_iam.types.certificate_id_type.certificateIdType",
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional[
        "capo_iam.types.existing_user_name_type.existingUserNameType"
    ] = None,
) -> None:
    """<p>Deletes a signing certificate associated with the specified IAM user.</p> <p>If you do not specify a user name, IAM determines the user name implicitly based on the Amazon Web Services access key ID signing the request. This operation works for access keys under the Amazon Web Services account. Consequently, you can use this operation to manage Amazon Web Services account root user credentials even if the Amazon Web Services account has no associated IAM users.</p>

    Args:
        user_name: <p>The name of the user the signing certificate belongs to.</p> <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
        certificate_id: <p>The ID of the signing certificate to delete.</p> <p>The format of this parameter, as described by its <a href="http://wikipedia.org/wiki/regex">regex</a> pattern, is a string of characters that can be upper- or lower-cased letters or digits.</p>

    Raises:
        capo_iam.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.</p>
        capo_iam.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.</p>
        capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
        capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete a signing certificate for an IAM user
        The following command deletes the specified signing certificate for the IAM user named Anika.

        >>> client.delete_signing_certificate(user_name='Anika', certificate_id='TA7SMP42TDN5Z26OBPJE7EXAMPLE')
    """

    def _handler(
        req: "OperationRequest[capo_iam.types.delete_signing_certificate_request.DeleteSigningCertificateRequest]",
    ) -> OperationResponse[None]:
        import capo_iam._operations.aws_identity_management_v20100508.delete_signing_certificate

        output, http_response = (
            capo_iam._operations.aws_identity_management_v20100508.delete_signing_certificate.delete_signing_certificate(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteSigningCertificate")
    )
    input_: capo_iam.types.delete_signing_certificate_request.DeleteSigningCertificateRequest = {
        "certificate_id": certificate_id
    }
    if user_name is not None:
        input_["user_name"] = user_name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output