Skip to content

update_service_specific_credential

update_service_specific_credential(
    service_specific_credential_id: serviceSpecificCredentialId,
    status: statusType,
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional[userNameType] = None,
) -> None

Sets the status of a service-specific credential to Active or Inactive. Service-specific credentials that are inactive cannot be used for authentication to the service. This operation can be used to disable a user's service-specific credential as part of a credential rotation work flow.

Parameters:

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

    The name of the IAM user associated with the service-specific credential. If you do not specify this value, then the operation assumes the user whose credentials are used to call the operation.

    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: _+=,.@-

  • service_specific_credential_id (serviceSpecificCredentialId) –

    The unique identifier of the service-specific credential.

    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 to be assigned to the service-specific credential.

Raises:

  • NoSuchEntityException –

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

  • UnknownServiceError –

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

Source code in docs_src/capo_iam/_services/iam.py
def update_service_specific_credential(
    self,
    service_specific_credential_id: "capo_iam.types.service_specific_credential_id.serviceSpecificCredentialId",
    status: "capo_iam.types.status_type.statusType",
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional["capo_iam.types.user_name_type.userNameType"] = None,
) -> None:
    """<p>Sets the status of a service-specific credential to <code>Active</code> or <code>Inactive</code>. Service-specific credentials that are inactive cannot be used for authentication to the service. This operation can be used to disable a user's service-specific credential as part of a credential rotation work flow.</p>

    Args:
        user_name: <p>The name of the IAM user associated with the service-specific credential. If you do not specify this value, then the operation assumes the user whose credentials are used to call the operation.</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>
        service_specific_credential_id: <p>The unique identifier of the service-specific credential.</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 to be assigned to the service-specific credential.</p>

    Raises:
        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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iam.types.update_service_specific_credential_request.UpdateServiceSpecificCredentialRequest]",
    ) -> OperationResponse[None]:
        import capo_iam._operations.aws_identity_management_v20100508.update_service_specific_credential

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateServiceSpecificCredential")
    )
    input_: capo_iam.types.update_service_specific_credential_request.UpdateServiceSpecificCredentialRequest = {
        "service_specific_credential_id": service_specific_credential_id,
        "status": status,
    }
    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