Skip to main content
Navigation
HomeTechnical ReferenceJournalGitHubGitHub
Sidebar — toggle document categories via the logo
PWA Pipeline — AWS CloudFormation Stack for PWAs

PWA Pipeline — AWS CloudFormation Stack for PWAs

June 8, 2020

Overview

PWA Pipeline is a one-click AWS CloudFormation stack that provisions all the infrastructure needed to host and deploy a Progressive Web Application. Instead of manually configuring S3 buckets, CloudFront distributions, Route53 records, SSL certificates, and CodePipelines, this template creates everything in a single launch.

The stack sets up a Gatsby.js-based PWA (a sample site is included) with automated deployments triggered on every push to GitHub. The architecture follows AWS best practices — separate buckets for the main site and www-to-non-www redirect, CloudFront CDN for global performance, and ACM for SSL termination.


Key Features

  • One-click launch: Entire infrastructure provisioned from a single CloudFormation template
  • Global CDN: CloudFront distribution for worldwide content delivery with low latency
  • SSL by default: ACM certificate integration with automatic Route53 DNS validation
  • www redirect: Automatic redirection from www.domain.com to domain.com
  • Automated pipelines: CodePipeline builds and deploys on every git push to the main branch
  • Sample Gatsby site: Includes a minimal PWA to validate the pipeline end-to-end

Architecture

The CloudFormation stack provisions:

ResourcePurpose
S3 Bucket (main)Hosts the production website
S3 Bucket (redirect)Redirects www to non-www domain
S3 Bucket (pipeline)Stores build artifacts
CloudFrontCDN distribution with SSL termination
Route53DNS record sets for root and www subdomain
CodePipelineAutomated build pipeline triggered by GitHub pushes
IAM Roles/PoliciesLeast-privilege access for pipeline operations

Tech Stack

LayerTechnology
InfrastructureAWS CloudFormation (YAML template)
HostingAWS S3 (static website hosting)
CDNAWS CloudFront
DNSAWS Route53
SSLAWS Certificate Manager (ACM)
CI/CDAWS CodePipeline
ApplicationGatsby.js (sample PWA included)