CDN CLI Commands | Wraps
CLI Reference / CDN
Deploy S3 + CloudFront CDN infrastructure to your AWS account with browser-based image optimization.
Pricing: Free to use. You pay AWS directly for storage (~$0.023/GB/month) and bandwidth (~$0.085/GB). A typical setup costs ~$5-7/month for 10GB storage + 50GB bandwidth.
wraps cdn init
Deploy CDN infrastructure (S3 bucket + CloudFront CDN) to your AWS account. Optionally configure a custom domain for your CDN.
-r, --region <region>
AWS region to deploy infrastructure (default: same as email, or us-east-1)
-d, --domain <domain>
Custom CDN domain (e.g., cdn.yourdomain.com). If you have email configured, the CLI will suggest a subdomain based on your email domain.
-p, --provider <provider>
Hosting provider: vercel, aws, railway, or other
--preview
Preview infrastructure changes without deploying
-y, --yes
Skip confirmation prompts
- S3 bucket (
wraps-cdn-{accountId}) with CORS configured - CloudFront distribution for global CDN delivery
- ACM SSL certificate (if custom domain specified)
- IAM permissions for console/dashboard uploads
- Origin Access Control for secure S3 access
wraps cdn status
Display the current status of your CDN infrastructure, including CDN domain, S3 bucket, and usage statistics.
- CDN domain (custom or CloudFront default)
- S3 bucket name and region
- Storage usage (GB)
- Bandwidth usage (GB)
- File count
- Estimated monthly AWS cost
wraps cdn verify
Verify DNS configuration and certificate status for your custom domain. Use this after adding DNS records to confirm everything is working.
-r, --region <region>
AWS region where CDN is deployed
- CloudFront distribution status (deployed and enabled)
- ACM certificate status (issued and valid)
- Certificate validation DNS records
- Custom domain CNAME pointing to CloudFront
- CloudFront alias configuration
wraps cdn upgrade
Add a custom domain to your CDN after the SSL certificate has been validated. Run this after cdn verify shows the certificate is issued.
- Adds the custom domain alias to CloudFront distribution
- Associates the validated SSL certificate
- Updates infrastructure state to mark domain as active
wraps cdn sync
Synchronize your local configuration with deployed infrastructure. Useful after CLI updates to apply fixes or when infrastructure state is out of sync.
- Re-runs Pulumi deployment with current configuration
- Updates CloudFront, S3, and IAM resources as needed
- Refreshes infrastructure state and stack outputs
wraps cdn destroy
Remove all CDN infrastructure from your AWS account. This is a destructive operation.
-f, --force
Skip confirmation prompt (use with caution)
--preview
Preview what would be destroyed without making changes
- S3 bucket and all stored files
- CloudFront distribution
- ACM certificate (if custom domain was configured)
- IAM permissions for CDN access
- Local metadata and Pulumi state
Note: You'll need to manually remove DNS records (CNAME) pointing to CloudFront.
Programmatic Uploads
For server-side uploads, use the AWS SDK directly. Your OIDC role or IAM credentials already have the necessary permissions.