What Gets Deployed: CDN
Every AWS resource Wraps creates when you run wraps cdn init.
Every AWS resource Wraps creates when you run wraps cdn init.
The CDN service provides S3 + CloudFront for hosting email assets and images. Assets are stored in a private S3 bucket and served globally through CloudFront with HTTPS and edge caching.
# CDN Asset Hosting Architecture## Upload --> S3 Bucket --> CloudFront (Global Edge) --> End Users# |# Origin Access Identity (OAI)# |# (Optional) ACM Certificate# +# Custom Domain## 1. Assets uploaded to private S3 bucket via SDK or CLI# 2. CloudFront serves assets from 400+ global edge locations# 3. OAI ensures S3 is only accessible through CloudFront# 4. Optional custom domain with auto-validated ACM certificateThese resources are always created when you deploy the CDN service.
wraps-cdn-{id}wraps-cdn-roleWhen you configure a custom domain (e.g., cdn.yourdomain.com), these additional resources are created.
us-east-1 (CloudFront requirement, regardless of your chosen region)Custom domain is optional
Without a custom domain, your assets are served from the default CloudFront URL (e.g., d1234abcdef8.cloudfront.net). A custom domain provides a branded URL for your email assets.
After deploying, use the SDK to upload assets and reference them in your emails.
import { Wraps } from '@wraps.dev/email';const wraps = new Wraps();// Upload an image to the CDNconst url = await wraps.cdn.upload({ file: './logo.png', path: 'images/logo.png', contentType: 'image/png',});// Use the CDN URL in your emailsconst result = await wraps.emails.send({ from: 'hello@yourapp.com', to: 'user@example.com', subject: 'Welcome!', html: `<img src="${url}" alt="Logo" />`,});CDN costs are based on storage and data transfer. All costs are billed directly by AWS.
| Component | Pricing | Notes |
|---|---|---|
| S3 Storage | ~$0.023/GB/mo | Standard storage class |
| CloudFront Data Transfer | ~$0.085/GB | First 10 TB/mo to internet |
| CloudFront Requests | ~$0.01/10K requests | HTTPS requests |
| ACM Certificate | Free | For use with CloudFront |
| CloudFront Invalidation | First 1,000 free/mo | $0.005 per path after |
Typical cost for email assets
Most email use cases (logos, header images, stylesheets) use minimal storage and transfer. Expect less than $1/mo for typical email asset hosting. The AWS Free Tier includes 1 TB of CloudFront data transfer for the first 12 months.
All CDN resources are tagged for identification and cost tracking.
| Tag Key | Tag Value | Description |
|---|---|---|
ManagedBy | wraps-cli | Identifies resources managed by Wraps |
All available CDN CLI commands and options.
View CLI DocsDeploy CDN infrastructure and upload your first asset.
Get StartedDeploy CDN infrastructure with CDK or Pulumi instead of the CLI.
View CDK Docs