Single-page application - AWS Serverless Multi-Tier Architectures with Amazon API Gateway and AWS Lambda

Single-page application

AWS architecture diagram showing interactions between services like CloudFront, S3, Lambda, and DynamoDB.

Architectural pattern for serverless single-page application

Table 2 - Single-page application components

Tier Components
Presentation

Static website content hosted in Amazon S3, distributed by CloudFront.

AWS Certificate Manager allows a custom SSL/TLS certificate to be used.

Logic

API Gateway with AWS Lambda.

This architecture shows three exposed services (/tickets, /shows, and /info). API Gateway endpoints are secured by a Lambda authorizer. In this method, users sign in through a third-party identity provider and obtain access and ID tokens. These tokens are included in API Gateway calls, and the Lambda authorizer validates these tokens and generates an IAM policy containing API initiation permissions.

Each Lambda function is assigned its own IAM role to provide access to the appropriate data source.

Data

Amazon DynamoDB is used for the /tickets and /shows services.

Amazon ElastiCache is used by the /shows service to improve database performance. Cache misses are sent to DynamoDB.

Amazon S3 is used to host static content used by the /info service.