The official deploy-stack integration for Astro.
astro-deploy-stack acts as an invisible bridge between your Astro project and AWS. It automatically optimizes Astro's network configuration for containerized environments and features a "Magic Auto-Provisioner" that scaffolds a production-ready AWS architecture directly during your build process.
What it generates under the hood:
- Compute & Networking: An AWS ECS Fargate cluster, Application Load Balancer, and CloudFront CDN.
- DevSecOps CI/CD: A GitHub Actions workflow utilizing keyless IAM OIDC and automated Trivy container vulnerability scanning.
- State Management: Native Terraform templates with an encrypted S3 remote state backend utilizing modern native concurrency locking.
For a full breakdown of the architecture, detailed features, and release notes, please visit the main deploy-stack repository.
Currently, the auto-provisioner runs in a strict zero-config mode. When it detects a missing infrastructure setup, it automatically defaults to a highly-optimized static deployment.
If you want to customize the generated infrastructure (e.g., changing the AWS region, modifying the compute tier, or injecting secrets), you can bypass the auto-provisioner by running the core CLI manually before you build:
# Run interactively to configure your exact setup
npx deploy-stackThe easiest way to install this integration is using the Astro CLI. Run this in your Astro project root:
npx astro add astro-deploy-stackIf you prefer to install manually:
- Install the package:
npm install astro-deploy-stack
- Add the integration to your
astro.config.mjs:import { defineConfig } from 'astro/config'; import deployStack from 'astro-deploy-stack'; export default defineConfig({ integrations: [deployStack()] });
This integration works entirely in the background during your standard Astro build (npm run build).
- Magic Auto-Provisioning: If no infrastructure exists in your project, it seamlessly invokes the
deploy-stackengine in headless mode. It automatically generates your Terraform templates, highly-optimized Dockerfile, and GitHub Actions CI/CD pipeline directly in your repository. - Smart SSR Optimization: If you are using Astro in
serverorhybridoutput modes, it automatically overrides the Astro server host to0.0.0.0to ensure Docker container port mapping functions correctly in AWS Fargate. - Contextual Syncing: If infrastructure is already generated, it politely reminds you to run
npx deploy-stack applyto sync your latest configuration and artifacts to the cloud.
This integration requires no manual configuration, but relies on the core deploy-stack engine. The auto-provisioner will safely fetch and execute the latest version of deploy-stack automatically during your build.
MIT