A production-ready Next.js (Standalone) application deployed to AWS ECS Fargate with zero-secret GitHub Actions CI/CD, auto-generated by deploy-stack.
Preview the complete architecture topology and dynamic cloud cost breakdown before deploying:
npx deploy-stack apply --dry-runThis configuration provisions an Application Load Balancer (ALB) and an ECS Fargate service (Micro: 0.25 vCPU, 512MB RAM).
- Estimated Baseline: ~$31.28 / month (ALB base + Fargate compute)
- Hourly Rate: ~$0.043 / hour
- Testing for an afternoon costs less than $0.20 before tearing down.
⚠️ Note: Cloud costs vary by usage, ingress/egress, and region. Always set up AWS Budget Alerts for active workloads.
Generate and apply the cloud stack directly from your project root:
npx deploy-stack apply --yesReview the pre-flight topology tree and type y to confirm.
If your Next.js application requires environment variables, push a local .env file directly to encrypted AWS Secrets Manager vaults:
npx deploy-stack secrets push .envCommit and push your repository to GitHub:
git add .
git commit -m "feat: deploy to aws via deploy-stack"
git push origin mainThe workflow utilizes the official deploy-stack GitHub Action and AWS IAM OpenID Connect (OIDC) to deploy keylessly with temporary security credentials. No long-lived AWS keys are stored in GitHub Secrets.
Next.js must produce a minimal self-contained server bundle for containerization. Ensure next.config.js or next.config.mjs contains output: 'standalone':
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
};
export default nextConfig;Every push triggers automated container and infrastructure scanning via Trivy:
- Navigate to the Actions tab in GitHub.
- Select the latest deployment workflow run.
- Review the Summary tab to inspect automated vulnerability and misconfiguration audits.
To tear down all provisioned resources (ALB, ECS, networking, and S3 state bucket) and halt AWS billing:
npx deploy-stack destroy --yes