title: How to Use AWS Cognito without using API Gateway for Custom Spring REST API Authorization
body: <p><strong>Scenario :</strong><br>
  I will have Spring boot REST API application running in any EC2 with exposing multiple APIs and I am not using AWS API Gateway for them.<br>
  I need multiple users for accessing multiple APIs with different roles (Admin, WriteUser, ReadUser).<br>
  I can create Users and Groups in Cognito Userpool and can have multiple Roles in IAM.</p>
  
  <p>How can I configure AWS Cognito's UserPool and IdentityPool to authorize different APIs access based on User role ? Is there any way to define such "API allow rules based on role" in Policy (associated with IdentityPool/Resource server) without using API Gateway.</p>
  
  <p>Thanks in Advance.</p>