Authenticate AWS AppSync Api with Amazon Cognito

AWS AppSync → Amazon Cognito → AWS Lambda

Create an appsync api and authenticate all request with AWS Cognito User Pools.

This sample projects demonstrates how to use AWS Cognito to authenticate an AWS Appsync API with lambda resolvers.The same concept can be applied to vtl resolvers as well.
This pattern deploys one appsync api, with a direct lamda resolver.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/appsync-cognito-lambda-cdk

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk delete.

Created by:

Rosius Ndimofor

Rosius Ndimofor

AWS Serverless Hero with a high affinity for building fullstack serverless apps

Follow on LinkedIn