Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Notes on using Cognito with Serverless

  • event.requestContext.identity.cognitoIdentityId should be the user id
  • Cognito User Pools are for handling user registration, authentication, and account recovery
  • Cognito Identity Pools (or Cognito Federated Identities) are a way to authorize users to directly use the various AWS services in your account, such as S3, DynamoDB, and, most relevant for APIs, API Gateway

CloudFormation in serverless.yml

    CognitoUserPoolMyUserPool: # Where "MyUserPool" is the name of the pool as used elsewhere in serverless.yml
      Type: AWS::Cognito::UserPool
        # Place the rest of the cft here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment