π Docs Β | Β β‘ Quickstart Β | Β π Slack
LaunchFlow is an open source Python SDK that lets you launch websites, APIs, and workers to AWS / GCP with minimal configuration.
- Serverless Deployments
- Auto-Scaling VMs
- Kubernetes Clusters (in preview)
- Static Sites (in preview)
- Terraform Resources
- Pulumi Resources (coming soon)
- Custom Resources (coming soon)
Use the Python SDK to define your infrastructure in code, then run lf deploy
to deploy everything to a dedicated VPC environment in your cloud account.
Fully customizable but configured by default - no messy YAML required.
Services - Docs
Services allow you to deploy websites, APIs, background workers and other types of applications to your cloud account with minimal setup.
Note
LaunchFlow is not just for deploying Python apps. The Python SDK is used to define your infrastructure in code, but you can deploy any application that runs on a VM, container, or serverless environment.
Python is just the language for your cloud configuration, similar to how Terraform uses HCL.
Click the dropdown below to see the service types that are currently supported.
Services Types
- Static Websites
- (AWS) S3 Static Site - coming soon
- (GCP) GCS Static Site with Load Balancer - coming soon
- (GCP) Firebase Static Site - coming soon
- Serverless APIs
- (AWS) Lambda Service - coming soon
- (GCP) Cloud Run Service - Docs
- Auto-Scaling VMs
- Kubernetes Clusters
- (AWS) EKS - coming soon
- (GCP) GKE - Docs
Resources - Docs
Resources are the cloud services that your application uses, such as databases, storage, queues, and secrets. LaunchFlow provides a simple way to define, manage, and use these resources in your application.
Click the dropdown below to see the resource types that are currently supported.
Resource Types
- Cloud Storage
- Postgres
- Redis
- Task Queues
- Secrets
- Custom Domains
- Monitoring & Alerts
- (AWS) CloudWatch - coming soon
- (GCP) StackDriver - coming soon
- Custom Terraform Resources - coming soon
- Custom Pulumi Resources - coming soon
Environments - Docs
Environments group Services and Resources inside a private network (VPC) on either GCP or AWS. You can create multiple environments for different stages of your workflow (e.g. development, staging, production) and switch between them with a single command.
pip install launchflow
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def index():
return f'Hello from {lf.environment}!'
from fastapi import FastAPI
import launchflow as lf
app = FastAPI()
@app.get("/")
def index():
return f'Hello from {lf.environment}!'
# Deploy this FastAPI app to ECS Fargate on AWS
api = lf.aws.ECSFargate("my-api")
lf deploy
- Generate a Dockerfile and launchflow.yaml file (if you don't have one)
- Create a new VPC (Environment) in your AWS account (if you don't have one)
- Create a new ECS Fargate service and task definition (if you don't have one)
- Create a new Application Load Balancer and Route 53 DNS record (if you don't have one)
- Build a Docker image and push it to ECR
- Deploy your FastAPI app to the new ECS Fargate service
- Output the URL & DNS settings of your new FastAPI app
from fastapi import FastAPI
import launchflow as lf
# Resource permissions are automatically configured for you
bucket = lf.gcp.S3Bucket("my-bucket")
app = FastAPI()
@app.get("/")
def index():
bucket.upload_from_string(f"Hello from {lf.environment}!", "hello.txt")
return bucket.download_file("hello.txt").decode()
# You can customize the Fargate service with Python
api = lf.aws.ECSFargate("my-api", domain="your-domain.com", memory=512, cpu=256)
lf deploy
Click the dropdowns below to see the example's code.
Deploy FastAPI to ECS Fargate (AWS)
from fastapi import FastAPI
import launchflow as lf
app = FastAPI()
@app.get("/")
def index():
return f'Hello from {lf.environment}!'
# Deploy this FastAPI app to ECS Fargate on AWS
api = lf.aws.ECSFargate("my-api", domain="your-domain.com")
Deploy FastAPI to Cloud Run (GCP)
from fastapi import FastAPI
import launchflow as lf
app = FastAPI()
@app.get("/")
def index():
return f'Hello from {lf.environment}!'
# Deploy Postgres hosted on (GCP) Cloud SQL
api = lf.gcp.CloudRun("my-api", domain="your-domain.com")
Deploy Postgres to RDS & EC2 (AWS)
import launchflow as lf
# Create / Connect to a Postgres Cluster on CloudSQL
postgres = lf.aws.RDSPostgres("postgres-cluster", disk_size_gb=10)
# Or on a Compute Engine VM
postgres = lf.aws.ComputeEnginePostgres("postgres-vm")
if __name__ == "__main__":
# Built-in utility methods for using Postgres
postgres.query("SELECT * FROM my_table")
# Built-in connectors for Python ORMs
postgres.sqlalchemy_engine()
postgres.django_settings()
Deploy Postgres to Cloud SQL & Compute Engine (GCP)
import launchflow as lf
# Create / Connect to a Postgres Cluster on CloudSQL
postgres = lf.gcp.CloudSQLPostgres("postgres-cluster", disk_size_gb=10)
# Or on a Compute Engine VM
postgres = lf.gcp.ComputeEnginePostgres("postgres-vm")
if __name__ == "__main__":
# Built-in utility methods for using Postgres
postgres.query("SELECT * FROM my_table")
# Built-in connectors for Python ORMs
postgres.sqlalchemy_engine()
postgres.django_settings()
Deploy a static React app to a CDN (GCP)
[!IMPORTANT]
This example is not yet available in the LaunchFlow Python SDK.
import launchflow as lf
# Deploy a static React app to a GCS Bucket with a CDN
bucket = lf.gcp.BackendBucket(
"react-app", "./dst" domain=f"{lf.environment}.app.launchflow.com"
)
if __name__ == "__main__":
# Use Python to easily automate non-Python applications
print(f"Bucket URL: {bucket.url}")
Full on scripting with Python (GCP)
[!IMPORTANT]
This example is not yet available in the LaunchFlow Python SDK.
import launchflow as lf
backend = lf.gcp.CloudRun(
"fastapi-api", domain=f"{lf.environment}.api.launchflow.com"
)
frontend = lf.gcp.BackendBucket(
"react-static-app",
static_directory="./dst",
domain=f"{lf.environment}.console.launchflow.com",
env={
"LAUNCHFLOW_API_URL": backend.url
}
)
result = lf.deploy(backend, frontend, environment="dev")
if not result.successful:
print(result.error)
exit(1)
print(f"Frontend URL: {frontend.url}")
print(f"Backend URL: {backend.url}")
Reach out to [email protected] to speed up development of the feature you need. Most of the unfinished features are already in development and can be completed in under a week - we just need to know what to prioritize!