{"id":35273256,"url":"https://github.com/ferdinandfrank/cdk-nuxt","last_synced_at":"2026-04-13T13:03:41.988Z","repository":{"id":57195486,"uuid":"456512021","full_name":"ferdinandfrank/cdk-nuxt","owner":"ferdinandfrank","description":"Deploy Nuxt applications via CDK on AWS.","archived":false,"fork":false,"pushed_at":"2026-03-12T11:34:39.000Z","size":527,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-02T17:41:06.998Z","etag":null,"topics":["aws","cdk","lambda","nuxt","s3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferdinandfrank.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2022-02-07T13:14:29.000Z","updated_at":"2026-03-12T11:34:22.000Z","dependencies_parsed_at":"2022-09-16T10:50:50.659Z","dependency_job_id":"88959450-f0bb-4ea6-add3-1b4494843476","html_url":"https://github.com/ferdinandfrank/cdk-nuxt","commit_stats":null,"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"purl":"pkg:github/ferdinandfrank/cdk-nuxt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferdinandfrank%2Fcdk-nuxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferdinandfrank%2Fcdk-nuxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferdinandfrank%2Fcdk-nuxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferdinandfrank%2Fcdk-nuxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferdinandfrank","download_url":"https://codeload.github.com/ferdinandfrank/cdk-nuxt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferdinandfrank%2Fcdk-nuxt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cdk","lambda","nuxt","s3"],"created_at":"2025-12-30T13:14:38.471Z","updated_at":"2026-04-09T00:03:22.470Z","avatar_url":"https://github.com/ferdinandfrank.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CDK Nuxt Deployment Stack (Nuxt 3 \u0026 Nuxt 4)\n\n\u003cp\u003e\n    \u003ca href=\"https://github.com/ferdinandfrank/cdk-nuxt/actions/workflows/publish.yml\"\u003e\u003cimg alt=\"Build\" src=\"https://img.shields.io/github/actions/workflow/status/ferdinandfrank/cdk-nuxt/publish.yml?logo=github\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/cdk-nuxt\"\u003e\u003cimg alt=\"Version\" src=\"https://img.shields.io/npm/v/cdk-nuxt.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/cdk-nuxt\"\u003e\u003cimg alt=\"Downloads\" src=\"https://img.shields.io/npm/dm/cdk-nuxt.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/cdk-nuxt\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/npm/l/cdk-nuxt.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nEasily deploy Nuxt applications (Nuxt 3 and Nuxt 4) via CDK on AWS, including the following features:\n\n- ⚡ **Fast responses** via [AWS Lambda](https://aws.amazon.com/lambda/)\n- 🌐 **Custom domain** support via [Route53](https://aws.amazon.com/route53/) and [CloudFront](https://aws.amazon.com/cloudfront/)\n- 🔒 **Automatic HTTPS** with certificate management\n- 📦 **Optimized static asset** delivery via [S3](https://aws.amazon.com/s3/)\n- 🔥 **Lambda warming** via scheduled [EventBridge](https://aws.amazon.com/eventbridge/) pings\n- 🗑️ **Automatic cleanup** of outdated assets\n- 📊 **Access logs analysis** via [Athena](https://aws.amazon.com/athena/) ([docs](docs/ACCESS_LOGS.md))\n- 🛡️ **WAF integration** for security ([docs](docs/WAF.md))\n- ⚙️ **Flexible caching** configuration ([docs](docs/CACHING.md))\n\n## Quick Links\n\n- 📚 [Full Configuration Reference](docs/CONFIGURATION.md)\n- 🚀 [Deployment Guide](docs/DEPLOYMENT.md)\n- 🛡️ [WAF Documentation](docs/WAF.md)\n- 📊 [Access Logs Analysis](docs/ACCESS_LOGS.md)\n- 🔄 [Caching Configuration](docs/CACHING.md)\n\n## Table of Contents\n\n- [Compatibility](#compatibility)\n- [Quick Start](#quick-start)\n- [AWS Resources Created](#aws-resources-created)\n- [Documentation](#documentation)\n\n## Compatibility\n\n- ✅ Nuxt 3 (latest stable)\n- ✅ Nuxt 4 (RC and stable)\n\n## Quick Start\n\n### 1. Installation\n\nInstall the package and its peer dependencies:\n\n```bash\n# Using pnpm (recommended)\npnpm add -D cdk-nuxt aws-cdk@^2.1110.0 aws-cdk-lib@^2.241.0 constructs@^10.5.0 typescript ts-node\n\n# Using npm\nnpm install --save-dev cdk-nuxt aws-cdk@^2.1110.0 aws-cdk-lib@^2.241.0 constructs@^10.5.0 typescript ts-node\n\n# Using yarn\nyarn add -D cdk-nuxt aws-cdk@^2.1110.0 aws-cdk-lib@^2.241.0 constructs@^10.5.0 typescript ts-node\n```\n\nThe AWS CDK CLI must be at least `2.1107.0` (check with `pnpm cdk --version`).\n\n**Optional:** If you plan to enable Access Logs Analysis:\n```bash\npnpm add -D @aws-cdk/aws-glue-alpha@2.241.0-alpha.0\n```\n\n### 2. Configure Nuxt\n\nSet the Nitro preset in your `nuxt.config.ts`:\n\n```typescript\nexport default defineNuxtConfig({\n  nitro: {\n    preset: 'aws-lambda'\n  },\n});\n```\n\n**Important:** Remove `\"type\": \"module\"` from your `package.json` if present ([why?](https://github.com/ferdinandfrank/cdk-nuxt/issues/3)).\n\n### 3. AWS Prerequisites\n\nBefore deployment, you need:\n\n1. **AWS Account** - [Create one](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) if you don't have one\n2. **Route53 Hosted Zone** - For your domain ([guide](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html))\n3. **SSL Certificates** - Two certificates for HTTPS:\n   - **Global certificate** (us-east-1) for CloudFront ([request](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html))\n   - **Regional certificate** (your region) for API Gateway ([request](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html))\n\n### 4. Initialize CDK Stack\n\nGenerate the CDK stack configuration:\n\n```bash\nnode_modules/.bin/cdk-nuxt-init-server\n```\n\nThis creates `stack/index.ts` with a complete template including all available configuration options with sensible defaults.\n\n**Update the following required values:**\n- `env.account` and `env.region` - Your AWS account and region\n- `project`, `service`, `environment` - Identifiers for your app\n- `domain` - Your custom domain\n- `hostedZoneId` - Your Route53 hosted zone ID  \n- `globalTlsCertificateArn` - Certificate in us-east-1 for CloudFront\n- `regionalTlsCertificateArn` - Certificate in your region for API Gateway\n\nThe full template can also be viewed here: [lib/templates/stack-index-server.ts](lib/templates/stack-index-server.ts)\n\nFor a complete list of all configuration options, see the [Configuration Reference](docs/CONFIGURATION.md).\n\n\u003e 💡 **Tip:** Use environment variables or a `.env` file to store sensitive values like certificate ARNs and AWS account IDs.\n\n### 5. Bootstrap and Deploy\n\nFirst-time setup (once per AWS account/region):\n```bash\ncdk bootstrap aws://YOUR_ACCOUNT_ID/YOUR_REGION\n```\n\n\u003e When using the [WAF via CloudFrontWafStack](docs/WAF.md) and using a different region than `us-east-1`, you also need to bootstrap `us-east-1` for the WAF resources:\n\u003e ```bash\n\u003e cdk bootstrap aws://YOUR_ACCOUNT_ID/us-east-1\n\u003e ```\n\nDeploy your app:\n```bash\nnode_modules/.bin/cdk-nuxt-deploy-server\n```\n\nThat's it! Your Nuxt app is now live on AWS. 🎉\n\nFor detailed deployment options and CI/CD setup, see the [Deployment Guide](docs/DEPLOYMENT.md).\n\n## AWS Resources Created\n\nWhen you deploy your Nuxt app, the following AWS resources are automatically created:\n\n- **Lambda Functions:**\n  - Main SSR function for rendering your Nuxt app\n  - Lambda Layer for node_modules\n  - Cleanup function for outdated assets\n\n- **S3 Buckets:**\n  - Static assets bucket (`.nuxt/dist/client`)\n  - Access logs bucket (if enabled)\n  \n- **CloudFront:**\n  - Global CDN distribution with HTTPS\n  - Optimized cache behaviors for static and dynamic content\n  \n- **API Gateway:**\n  - HTTP API for Lambda function access\n  - Custom domain configuration\n  \n- **Route53:**\n  - DNS records (A and AAAA) for your domain\n  \n- **EventBridge Rules:**\n  - Lambda warming (every 5 minutes)\n  - Asset cleanup (weekly, Tuesdays at 03:30 GMT)\n  \n- **Athena (optional):**\n  - Database and tables for access log analysis\n  - Automatic log partitioning\n\n- **WAF (optional):**\n  - Web Application Firewall for CloudFront distribution\n  - Protection against common web exploits, bots, and DDoS attacks\n  - Configurable managed rules and rate limiting\n\nFor more details on each resource and their configuration, see the [Deployment Guide](docs/DEPLOYMENT.md).\n\n## Documentation\n\n### Getting Started\n- [Quick Start](#quick-start) - Get up and running quickly\n- [Deployment Guide](docs/DEPLOYMENT.md) - Detailed deployment instructions, CI/CD setup\n- [Configuration Reference](docs/CONFIGURATION.md) - Complete list of all configuration options\n\n### Features\n- [WAF Integration](docs/WAF.md) - Protect your app with AWS WAF\n- [Access Logs Analysis](docs/ACCESS_LOGS.md) - Analyze traffic with Athena\n- [Caching Configuration](docs/CACHING.md) - Optimize performance with CloudFront caching\n\n### Advanced\n- [Destroy the Stack](#destroy-the-stack) - Clean up resources\n\n## Destroy the Stack\n\nTo completely remove all AWS resources created by this package:\n\n```bash\nnode_modules/.bin/cdk-nuxt-destroy-server\n```\n\n⚠️ **Warning:** This permanently deletes all resources including S3 buckets and logs. This action cannot be undone.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- 📖 [Documentation](docs/)\n- 🐛 [Issue Tracker](https://github.com/ferdinandfrank/cdk-nuxt/issues)\n- 💬 [Discussions](https://github.com/ferdinandfrank/cdk-nuxt/discussions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferdinandfrank%2Fcdk-nuxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferdinandfrank%2Fcdk-nuxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferdinandfrank%2Fcdk-nuxt/lists"}