Skip to content

reset_service_specific_credential

reset_service_specific_credential(
    service_specific_credential_id: serviceSpecificCredentialId,
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional[userNameType] = None,
) -> ResetServiceSpecificCredentialResponse

Resets the password for a service-specific credential. The new password is Amazon Web Services generated and cryptographically strong. It cannot be configured by the user. Resetting the password immediately invalidates the previous password associated with this user.

Parameters:

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

    The name of the IAM user associated with the service-specific credential. If this value is not specified, 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.

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 reset_service_specific_credential(
    self,
    service_specific_credential_id: "capo_iam.types.service_specific_credential_id.serviceSpecificCredentialId",
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    user_name: Optional["capo_iam.types.user_name_type.userNameType"] = None,
) -> "capo_iam.types.reset_service_specific_credential_response.ResetServiceSpecificCredentialResponse":
    """<p>Resets the password for a service-specific credential. The new password is Amazon Web Services generated and cryptographically strong. It cannot be configured by the user. Resetting the password immediately invalidates the previous password associated with this user.</p>

    Args:
        user_name: <p>The name of the IAM user associated with the service-specific credential. If this value is not specified, 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>

    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.reset_service_specific_credential_request.ResetServiceSpecificCredentialRequest]",
    ) -> OperationResponse[
        "capo_iam.types.reset_service_specific_credential_response.ResetServiceSpecificCredentialResponse"
    ]:
        import capo_iam._operations.aws_identity_management_v20100508.reset_service_specific_credential

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

    def _redact_output(
        output: "capo_iam.types.reset_service_specific_credential_response.ResetServiceSpecificCredentialResponse",
    ) -> dict[str, Any]:
        import capo_iam.types.reset_service_specific_credential_response

        return capo_iam.types.reset_service_specific_credential_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ResetServiceSpecificCredential", redact_output=_redact_output
        ),
    )
    input_: capo_iam.types.reset_service_specific_credential_request.ResetServiceSpecificCredentialRequest = {
        "service_specific_credential_id": service_specific_credential_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