title: How to disable Cognito user after exceeding the unsuccessful login attempts
body: <p>I have an angular app, which uses AWS Cognito for authentication and I want to disable users after 5 unsuccessful attempts. There is a method <code>adminDisableUser()</code> but it requires admin credentials.
  I am thinking of Lambda function, which should be triggered on <em>Pre sign-up</em> or <em>Pre authentication</em>, which should check if the attempt is successful or not. If it is unsuccessful it should increment the value of a custom attribute, for example <code>custom:failedAttempts</code>. If the value is equal to 5, the user should be disabled. The lambda can be executed with admin permission, so it that it can use the <code>adminUpdateUserAttributes()</code> and <code>adminDisableUser()</code>
  However, I am not really sure how this can happen, because I am new to AWS lambdas and IAM.
  Thank you in advance!</p>