title: AWS Cognito Error: 'identityPoolId' failed to satisfy constraint
body: <p>I am new Cognito. I am trying to implement AWS Cognito using Lambda. This is the <a href="https://java.awsblog.com/blog/author/Dhruv+Thukral" rel="noreferrer">tutorial</a> I am following. </p>
  
  <pre><code>AmazonCognitoIdentityClient client =
                  new AmazonCognitoIdentityClient();
      GetOpenIdTokenForDeveloperIdentityRequest tokenRequest = new GetOpenIdTokenForDeveloperIdentityRequest();
      tokenRequest.setIdentityPoolId("us-east-1_XXXXXXX");
  </code></pre>
  
  <p>This is the pool Id that I am using in the setIdentityPoolId</p>
  
  <p><a href="https://i.stack.imgur.com/D8tjS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/D8tjS.png" alt="enter image description here"></a></p>
  
  <p>This is the JUnit test</p>
  
  <pre><code>public class AuthenticateUser implements RequestHandler&lt;Object, Object&gt; {
  
  @Override
  public Object handleRequest(Object input, Context context) {
  
      AuthenticateUserResponse authenticateUserResponse = new AuthenticateUserResponse();
      @SuppressWarnings("unchecked")
      LinkedHashMap inputHashMap = (LinkedHashMap)input;
      User user = authenticateUser(inputHashMap);
      return null;
  }
  
  public User authenticateUser(LinkedHashMap input){
      User user = null;
      String userName = (String) input.get("userName");
      String passwordHash = (String) input.get("passwordHash");
  
      try {
          AmazonDynamoDBClient client = new AmazonDynamoDBClient();
          client.setRegion(Region.getRegion(Regions.US_EAST_1));
          DynamoDBMapper mapper = new DynamoDBMapper(client);
          user = mapper.load(User.class, userName);
  
          if(user != null){
              System.out.println("user found");
              if(user.getPasswordHash().equals(passwordHash)){
                  System.out.println("user password matched");
                  String openIdToken = getOpenIdToken(user.getUserId());
                  user.setOpenIdToken(openIdToken);
                  return user;
              } else {
                  System.out.println("password unmatched");
              }
          } else {
              System.out.println("user not found");
          }
      } catch (Exception e) {
          System.out.println("Error: " + e.toString());
      }
  
      return user; 
  }
  </code></pre>
  
  <p>This is the output</p>
  
  <pre><code>user found
  user password matched
  </code></pre>
  
  <p>But I am getting the following error and hence, the <code>return user</code> statement is failing</p>
  
  <pre><code>1 validation error detected: Value 'us-east-1_XXXXXX' at 'identityPoolId' 
  failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+ 
  (Service: AmazonCognitoIdentity; Status Code: 400; Error Code: ValidationException; 
  </code></pre>