Stackattack
Production-ready AWS infrastructure components for Pulumi. Deploy complex applications with minimal code using secure, opinionated defaults.
Get Started | Components | Examples
What is StackAttack?
StackAttack eliminates infrastructure boilerplate by providing battle-tested AWS components built on Pulumi. Instead of writing hundreds of lines of infrastructure code, deploy production-ready applications with a fraction of the effort it takes to wire it all up yourself. The following config deploys service to ECS with a database in ~30 lines:
import * as saws from "@stackattack/aws";
const ctx = saws.context();
const domain = "api.mydomain.com";
const vpc = saws.vpc(ctx, { cidr: "10.0.0.0/16" });
const db = saws.database(ctx, { network: vpc.network("private") });
const certificate = saws.certificate(ctx, { domain });
const loadBalancer = saws.loadBalancer(ctx, {
network: vpc.network("public"),
cerificate
});
const cluster = saws.cluster(ctx, { network: vpc.network("private") });
const app = saws.service(ctx, {
cluster,
domain,
image: "my-app:latest",
loadBalancer,
port: 3000,
env: { DATABASE_URL: db.url }
});
export const appUrl = app.url;
Key Features
- Secure by Default - Encryption, private subnets, least-privilege IAM
- Deploy in Minutes - From zero to production infrastructure
- TypeScript First - Full type safety and excellent IDE support
- Composable - Mix and match components for any architecture
- Well Documented - Comprehensive guides and examples
Available Components
Networking & Security: VPC, Load Balancer, VPN, Certificates
Compute: ECS Clusters, Services, Static Sites
Storage: S3 Buckets, RDS Databases, Redis
Integration: Email Domains, GitHub Actions, Webhooks
View all components
Quick Start
npm install @stackattack/aws
Create a stack, or use the components within an existing stack:
import * as saws from "@stackattack/aws";
const ctx = saws.context();
const domain = "my.astro.site";
const bucket = saws.bucket(ctx, { paths: ["./dist"] })
saws.staticSite(ctx, {
bucket,
domain,
adapter: saws.astroAdapter(),
});
export const url = `https://${domain}`;
Deploy with Pulumi:
pulumi up
Test your deployed resources:
curl https://my.astro.site
Full Documentation
Philosophy
Most infrastructure-as-code requires too much boilerplate. StackAttack provides the 80% solution that works for most production applications, with the flexibility to customize when needed.
Composition over Inheritance - Simple functions that work together
Secure Defaults - Best practices built-in, not bolted-on
Copy-Paste Friendly - No vendor lock-in, functions you can own