AWS · Amazon S3 + CloudFront · Diagram as code

S3 + CloudFront architecture diagram

Put CloudFront in front of an S3 origin for static assets, and optionally route API paths to API Gateway. ArchLex checks the routes relationship and draws official icons.

CloudFront with an S3 origin.

CDN in front of a static site bucket.

S3 CloudFront architecture diagram: CloudFront CDN routes to an S3 static site originS3 CloudFront architecture diagram: CloudFront CDN routes to an S3 static site origin
provider aws
direction LR

cdn: cloudfront["CDN"]
origin: s3["Static site"]

cdn -[routes]-> origin

Open this diagram in the playground

Static site plus API behind CloudFront.

Route 53 → CloudFront, with separate routes to S3 and API Gateway.

S3 CloudFront architecture diagram: Route 53 to CloudFront routing to S3 static assets and API GatewayS3 CloudFront architecture diagram: Route 53 to CloudFront routing to S3 static assets and API Gateway
provider aws
direction LR

dns: route53["app.example.com"]
cdn: cloudfront["CDN"]
origin: s3["Static assets"]
api: api-gateway["API"]

dns > cdn
cdn -[routes]->|static| origin
cdn -[routes]->|api| api

Open this diagram in the playground

Pattern notes for Amazon S3 + CloudFront.

Placement and relationship rules ArchLex enforces for this service.

Ask an agent to draw it.

Install the ArchLex skill or connect the free MCP server, then paste this prompt.

Agent skill install
npx skills add baires/archlex
Draw an S3 + CloudFront architecture diagram with Route 53 pointing at CloudFront, a static S3 origin, and an API Gateway route. Validate it and give me a playground link.

Prefer MCP? Follow the MCP server guide.

Related AWS examples.

Browse all examples

Amazon S3 + CloudFront diagram questions.

How do I diagram CloudFront in front of S3?

Declare cloudfront and s3 resources, then connect them with cdn -[routes]-> origin. Add a label on the edge when you have multiple origins.

Can one CloudFront distribution front S3 and an API?

Yes. Draw two routes from cloudfront: one to s3 and one to api-gateway. ArchLex allows both as routes targets.

Does ArchLex check bucket policies or OAC?

No. It checks the diagram graph. Origin access control, bucket policies, and cache behaviors are not inferred.

Which icons does it use?

Official AWS Architecture Icons for Amazon S3 and Amazon CloudFront, sanitized into the SVG output.

More AWS service diagrams.

Open source · MIT licensed

Diagram Amazon S3 + CloudFront as code.