Introduction

What is Stacktape?

Stacktape is a deployment framework that gives you the simplicity of a PaaS (like Heroku, Vercel, or Render) while deploying directly to your own AWS account. No vendor lock-in. No black-box infrastructure. Full control.

The Problem

Deploying to AWS is powerful but painful. You need to understand CloudFormation, IAM, VPCs, security groups, and dozens of other services. Even a simple API with a database requires 1,000+ lines of infrastructure code.

PaaS solutions like Heroku are easy, but you give up control, pay premium prices, and get locked in.

The Solution

Stacktape lets you define your entire infrastructure in ~30 lines of TypeScript instead of 1,200+ lines of CloudFormation. It deploys to your AWS account, following all AWS well-architected best practices.

import { defineConfig, HttpApiGateway, LambdaFunction, RelationalDatabase } from 'stacktape';

export default defineConfig(({ stage }) => {
  const db = new RelationalDatabase({
    engine: { type: 'postgres', version: '16' },
    credentials: { masterUserPassword: $Secret('db-password') }
  });

  const api = new HttpApiGateway({});

  const handler = new LambdaFunction({
    packaging: { entryfilePath: './src/handler.ts' },
    connectTo: [db], // Auto-injects DB credentials + grants permissions
    events: [{ httpApi: api, method: 'GET', path: '/' }]
  });

  return { resources: { db, api, handler } };
});

Deploy with one command:

stacktape deploy --stage production --region us-east-1

Why Stacktape?

TypeScript-First Configuration

Define infrastructure with full type safety, autocomplete, and the ability to use loops, conditionals, and functions. YAML and JSON also supported.

Development Mode

Run your services locally while connected to real cloud resources. Databases run in Docker, Lambda functions hot-reload, and everything just works.

Zero Lock-in

Everything deploys to standard AWS services (Lambda, ECS, RDS, etc.). You can inspect, extend, override, or eject at any time.

30+ Resource Types

Containers, serverless functions, databases (Postgres, MySQL, DynamoDB, MongoDB Atlas), Redis, queues, CDN, authentication, and more.

Quick Example

A full-stack app with a Next.js frontend, API, and database:

import { defineConfig, NextjsWeb, LambdaFunction, RelationalDatabase, HttpApiGateway } from 'stacktape';

export default defineConfig(({ stage }) => {
  const db = new RelationalDatabase({
    engine: { type: 'postgres', version: '16' }
  });

  const api = new HttpApiGateway({
    customDomains: [{ domainName: `api.${stage}.myapp.com` }]
  });

  const backend = new LambdaFunction({
    packaging: { entryfilePath: './api/index.ts' },
    connectTo: [db],
    events: [{ httpApi: api, method: '*', path: '/*' }]
  });

  const frontend = new NextjsWeb({
    customDomains: [{ domainName: `${stage}.myapp.com` }],
    environment: { NEXT_PUBLIC_API_URL: api.url }
  });

  return { resources: { db, api, backend, frontend } };
});

Get Started

Supported Resources