This is just a sample serverless app to access private files to S3 Bucket with cognito authentication.
$ git clone https://github.com/yashwant/sample-serverless-documents-management-api-using-s3-cognito
$ cd sample-serverless-documents-management-api-using-s3-cognito
$ npm install
$ mv aws_params.tp aws_params
$ serverless deploy
$ aws cognito-idp
$ aws cognito-idp list-user-pools --max-results 20
$ aws cognito-idp list-user-pool-clients --user-pool-id <pool id>
$ aws cognito-idp sign-up --region us-east-1 --client-id <client id> --username <email> --password <password>
$ aws cognito-idp admin-confirm-sign-up --region us-east-1 --user-pool-id <pool id> --username <user email>
Use sample-s3-file-upload-download react sample code to access these apis