Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New serverless pattern - apigw-http-api-cognito-lambda-cdk #2201

Closed
philippewanner opened this issue Mar 25, 2024 · 2 comments
Closed

New serverless pattern - apigw-http-api-cognito-lambda-cdk #2201

philippewanner opened this issue Mar 25, 2024 · 2 comments

Comments

@philippewanner
Copy link

philippewanner commented Mar 25, 2024

Description (mid-length e.g. "Create a Lambda function that sends events to EventBridge.")

This pattern creates an Amazon API Gateway HTTP API with JWTAuthorizer and Cognito as user management. It integrates with one public Lambda and one protected Lambda.

Language: (optional e.g. "Python", if you have a Lambda function in your example)

Node.js

Framework (currently we support SAM or CDK)

CDK

Services from/to (e.g. "Lambda to EventBridge)

Amazon API Gateway to public Lambda
Amazon API Gateway to protected Lambda
Amazon API Gateway to AWS Cognito

Description (this must include a throughout explanation of the pattern together with details of IAM permissioning)

This pattern creates an Amazon API Gateway API HTTP API and two endpoints. The first endpoint is unprotected (no authentication/authorization) and integrate with a public Lambda function. The second endpoint is protected by a JWTAuthorizer that use Cognito as IDP and it integrates with a private Lambda function.

Deployment commands

cdk deploy

GitHub PR for template:

#2200

Payload example (e.g. Lambda event payload from source service).

N/A

Additional resources (optional: link and anchor text, up to 5 resources)

Working with the AWS CDK in TypeScript
Working with HTTP APIs
Building Lambda functions with TypeScript

Author bio

Name: Philippe Wanner
Photo URL: https://www.linkedin.com/in/philippe-wanner/
LinkedIn: https://www.linkedin.com/in/philippe-wanner/
Twitter handle: n/a
Description (up to 255 chars): Philippe is a Senior Specialist Solutions Architect at Amazon Web Services based in Zurich, Switzerland. His role is to spread the migration and modernization best practices for large organisations.
Follow on LinkedIn

@julianwood
Copy link
Contributor

Thanks, merged

@julianwood
Copy link
Contributor

Thanks, merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants