Skip to content

update_signing_certificate async

update_signing_certificate(
    certificate_id: certificateIdType,
    status: statusType,
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    user_name: Optional[existingUserNameType] = None,
) -> None

Changes the status of the specified user signing certificate from active to disabled, or vice versa. This operation can be used to disable an IAM user's signing certificate as part of a certificate rotation work flow.

If the UserName field is not specified, the user name is determined implicitly based on the Amazon Web Services access key ID used to sign 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 users.

Parameters:

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

    The name of the IAM 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 you want to update.

    This parameter allows (through its regex pattern) a string of characters that can consist of any upper or lowercased letter or digit.

  • status (statusType) –

    The status you want to assign to the certificate. Active means that the certificate can be used for programmatic calls to Amazon Web Services Inactive means that the certificate cannot be used.

Raises:

  • InvalidInputException –

    The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • 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 change the active status of a signing certificate for an IAM user The following command changes the status of a signing certificate for a user named Bob to Inactive.

>>> await client.update_signing_certificate(user_name='Bob', certificate_id='TA7SMP42TDN5Z26OBPJE7EXAMPLE', status='Inactive')
Source code in docs_src/capo_iam/_services/async_iam.py
async def update_signing_certificate(
    self,
    certificate_id: "capo_iam.types.certificate_id_type.certificateIdType",
    status: "capo_iam.types.status_type.statusType",
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    user_name: Optional[
        "capo_iam.types.existing_user_name_type.existingUserNameType"
    ] = None,
) -> None:
    """<p>Changes the status of the specified user signing certificate from active to disabled, or vice versa. This operation can be used to disable an IAM user's signing certificate as part of a certificate rotation work flow.</p> <p>If the <code>UserName</code> field is not specified, the user name is determined implicitly based on the Amazon Web Services access key ID used to sign 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 users.</p>

    Args:
        user_name: <p>The name of the IAM 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 you want to update.</p> <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters that can consist of any upper or lowercased letter or digit.</p>
        status: <p> The status you want to assign to the certificate. <code>Active</code> means that the certificate can be used for programmatic calls to Amazon Web Services <code>Inactive</code> means that the certificate cannot be used.</p>

    Raises:
        capo_iam.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</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 change the active status of a signing certificate for an IAM user
        The following command changes the status of a signing certificate for a user named Bob to Inactive.

        >>> await client.update_signing_certificate(user_name='Bob', certificate_id='TA7SMP42TDN5Z26OBPJE7EXAMPLE', status='Inactive')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iam.types.update_signing_certificate_request.UpdateSigningCertificateRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_iam._operations.aws_identity_management_v20100508.update_signing_certificate

        (
            output,
            http_response,
        ) = await capo_iam._operations.aws_identity_management_v20100508.update_signing_certificate.async_update_signing_certificate(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSigningCertificate")
    )
    input_: capo_iam.types.update_signing_certificate_request.UpdateSigningCertificateRequest = {
        "certificate_id": certificate_id,
        "status": status,
    }
    if user_name is not None:
        input_["user_name"] = user_name

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