Ga naar hoofdinhoud

Pulumi

Infrastructure as Code using Pulumi with TypeScript for deploying Ever Gauzy.

Why Pulumi​

  • TypeScript β€” same language as the platform codebase
  • Type safety β€” compile-time infrastructure validation
  • Real programming β€” loops, conditions, functions
  • Multi-cloud β€” AWS, GCP, Azure, DigitalOcean

Directory Structure​

.deploy/pulumi/
β”œβ”€β”€ Pulumi.yaml # Project configuration
β”œβ”€β”€ Pulumi.prod.yaml # Production stack config
β”œβ”€β”€ index.ts # Main infrastructure code
β”œβ”€β”€ package.json # Dependencies
└── tsconfig.json # TypeScript config

Quick Start​

cd .deploy/pulumi

# Install dependencies
yarn install

# Login to Pulumi
pulumi login

# Create stack
pulumi stack init production

# Preview changes
pulumi preview

# Deploy
pulumi up

# Destroy
pulumi destroy

Example​

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Database
const db = new aws.rds.Instance("gauzy-db", {
engine: "postgres",
engineVersion: "16",
instanceClass: "db.t3.medium",
allocatedStorage: 50,
dbName: "gauzy",
username: "gauzy_admin",
password: pulumi.secret("secure-password"),
storageEncrypted: true,
});

// S3 for file storage
const bucket = new aws.s3.Bucket("gauzy-uploads", {
acl: "private",
versioning: { enabled: true },
});

// ECS Cluster
const cluster = new aws.ecs.Cluster("gauzy-cluster");

// Export outputs
export const dbEndpoint = db.endpoint;
export const bucketName = bucket.id;