title: Looking for Python example to search for a Cognito identity and update attributes
body: <p>I am integrating a payment solution which uses web hooks. The payment provider is given the Cognito userid (or user sub) during checkout. Upon successful checkout, the payment provider calls a web hook which I've implemented using AWS Lambda/Gateway and Python. Within this web hook I get the payment status and the Cognito user id.</p>
  
  <p>What I'd like to do next is update or set an attribute on the given Cognito user id for the subscription status. </p>
  
  <p>I've found pieces of JavaScript code which seem like they get me sort of there but I am missing something from how this should work. Here is the JS code I found to search for a user:</p>
  
  <pre><code>var cog = new AWS.CognitoIdentityServiceProvider();
  
  var filter = "sub = \"" + userSub + "\"";
  var req = {
      "Filter": filter,
      "UserPoolId": "your pool id" // looks like us-east-9_KDFn1cvys
  };
  
  cog.listUsers(req, function(err, data) {
      if (err) {
          console.log(err);
      }
      else {
          if (data.Users.length === 1){ //as far as we search by sub, should be only one user.
              var user = data.Users[0];
              var attributes = data.Users[0].Attributes;
          } else {
              console.log("Something wrong.");
          }
      }
  });
  </code></pre>
  
  <p>I need a Python version of the above... also I am not quite sure how to initialize the AWS.CognitoIdentityServiceProvider in order to do the search. It seems like I need to have an IAM credentials set up in order to search a user identity pool, no? </p>
  
  <p>Any pointers on how to search for a user in a Cognito identity pool using Python would be appreciated!</p>