{"id":43407328,"url":"https://github.com/stacksjs/ts-cloud","last_synced_at":"2026-05-28T00:01:35.240Z","repository":{"id":324316368,"uuid":"1096757483","full_name":"stacksjs/ts-cloud","owner":"stacksjs","description":"Zero-dependency, modern infrastructure-as-code framework.","archived":false,"fork":false,"pushed_at":"2026-05-20T15:02:15.000Z","size":34744,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-20T15:55:29.536Z","etag":null,"topics":["aws","cdk","cloud","cloud-development-kit","iac","infrastructure"],"latest_commit_sha":null,"homepage":"https://ts-cloud.stacksjs.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["stacksjs","chrisbbreuer"],"open_collective":"stacksjs"}},"created_at":"2025-11-14T22:44:33.000Z","updated_at":"2026-05-20T11:40:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stacksjs/ts-cloud","commit_stats":null,"previous_names":["stacksjs/ts-cloud"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/stacksjs/ts-cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/ts-cloud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-cloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cdk","cloud","cloud-development-kit","iac","infrastructure"],"created_at":"2026-02-02T16:10:36.256Z","updated_at":"2026-05-28T00:01:35.197Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/stacksjs","https://github.com/sponsors/chrisbbreuer","https://opencollective.com/stacksjs"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\".github/art/cover.jpg\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# ts-cloud\n\n\u003e Zero-dependency AWS infrastructure as TypeScript. Deploy production-ready cloud infrastructure without AWS SDK or CLI.\n\n## Overview\n\nts-cloud is a modern infrastructure-as-code framework that lets you define AWS infrastructure using TypeScript configuration files. Unlike AWS CDK or Terraform, ts-cloud:\n\n- **Zero AWS Dependencies** - No AWS SDK, no AWS CLI. Direct AWS API calls only.\n- **Type-Safe Configuration** - Full TypeScript types for all AWS resources\n- **Production-Ready Presets** - 13 battle-tested infrastructure templates\n- **Bun-Powered** - Lightning-fast builds and deployments\n- **CloudFormation Native** - Generate clean, reviewable CloudFormation templates\n\n## Features\n\n### 🚀 Configuration Presets\n\nSkip the boilerplate with production-ready presets for common architectures:\n\n- **Static Sites** - S3 + CloudFront for SPAs and static websites\n- **Node.js Servers** - EC2 + ALB + RDS + Redis for traditional apps\n- **Serverless Apps** - ECS Fargate + ALB + DynamoDB for scalable services\n- **Full-Stack Apps** - Complete frontend + backend + database stack\n- **API Backends** - API Gateway + Lambda + DynamoDB for serverless APIs\n- **WordPress** - Optimized WordPress hosting with RDS + EFS + CloudFront\n- **JAMstack** - Modern static sites with Lambda@Edge for SSR\n- **Microservices** - Multi-service architecture with service discovery\n- **Real-time Apps** - WebSocket API + Lambda + DynamoDB Streams\n- **Data Pipelines** - Kinesis + Lambda + S3 + Athena + Glue for ETL\n- **ML APIs** - SageMaker + API Gateway for ML inference\n- **Traditional Web Apps** - Session-based apps with EFS + Redis + ALB\n\n### 🛠️ Infrastructure Builders\n\nComplete CloudFormation template builders for:\n\n- **Network** - VPC, subnets, NAT gateways, routing, security groups\n- **Storage** - S3 buckets with versioning, encryption, lifecycle rules, EFS\n- **Compute** - EC2 Auto Scaling, ECS Fargate, Lambda functions\n- **Database** - RDS (PostgreSQL/MySQL), DynamoDB with streams and GSIs\n- **Cache** - ElastiCache Redis/Memcached with replication\n- **CDN** - CloudFront distributions with custom domains and Lambda@Edge\n- **API Gateway** - HTTP, REST, and WebSocket APIs\n- **Queue** - SQS queues with dead letter queues\n- **Messaging** - SNS topics and subscriptions\n- **Monitoring** - CloudWatch dashboards, alarms, and log groups\n- **Security** - ACM certificates, WAF rules, security groups\n\n### 🔒 Pre-Deployment Security Scanning\n\nBuilt-in secret detection to prevent accidental credential exposure:\n\n- **35+ Secret Patterns** - AWS keys, API tokens, private keys, database credentials\n- **Automatic Scanning** - Runs before every deployment\n- **Configurable Severity** - Block on critical, high, medium, or low findings\n- **CI/CD Ready** - Integrate security checks into your pipeline\n\n```bash\n# Scan for secrets before deploying\ncloud deploy:security-scan --source ./dist\n\n# Deploy with automatic security scanning\ncloud deploy  # Scans automatically before deployment\n```\n\n### ☁️ Direct AWS Integration\n\nNo SDK, no CLI - pure AWS Signature V4 API calls:\n\n- **CloudFormation** - CreateStack, UpdateStack, DeleteStack, DescribeStacks\n- **S3** - PutObject, multipart upload, sync directory\n- **CloudFront** - Cache invalidations with wait support\n- **Credentials** - Resolve from env vars, ~/.aws/credentials, or IAM roles\n\n## Quick Start\n\n### Installation\n\n```bash\nbun add ts-cloud\n```\n\n### Your First Deployment\n\nCreate a `cloud.config.ts`:\n\n```typescript\nimport { createStaticSitePreset } from 'ts-cloud/presets'\n\nexport default createStaticSitePreset({\n  name: 'My Website',\n  slug: 'my-website',\n  domain: 'example.com',\n})\n```\n\nDeploy:\n\n```bash\nbun run cloud deploy\n```\n\nThat's it! You now have:\n\n- ✅ S3 bucket with static website hosting\n- ✅ CloudFront CDN with HTTPS\n- ✅ Route53 DNS configuration\n- ✅ ACM SSL certificate\n\n### More Examples\n\n#### Full-Stack Application\n\n```typescript\nimport { createFullStackAppPreset } from 'ts-cloud/presets'\n\nexport default createFullStackAppPreset({\n  name: 'My App',\n  slug: 'my-app',\n  domain: 'app.example.com',\n  apiSubdomain: 'api.example.com',\n})\n```\n\nIncludes:\n\n- Frontend: S3 + CloudFront\n- Backend: ECS Fargate with auto-scaling\n- Database: PostgreSQL RDS with Multi-AZ\n- Cache: Redis ElastiCache\n- Queue: SQS for background jobs\n\n#### Serverless API\n\n```typescript\nimport { createApiBackendPreset } from 'ts-cloud/presets'\n\nexport default createApiBackendPreset({\n  name: 'My API',\n  slug: 'my-api',\n  domain: 'api.example.com',\n})\n```\n\nIncludes:\n\n- API Gateway HTTP API\n- Lambda functions with auto-scaling\n- DynamoDB tables with on-demand billing\n- CloudWatch monitoring and alarms\n\n## Configuration\n\n### Extending Presets\n\nYou can extend any preset with custom configuration:\n\n```typescript\nimport { createNodeJsServerPreset, extendPreset } from 'ts-cloud/presets'\n\nexport default extendPreset(\n  createNodeJsServerPreset({\n    name: 'My App',\n    slug: 'my-app',\n  }),\n  {\n    infrastructure: {\n      compute: {\n        server: {\n          instanceType: 't3.large', // Upgrade instance type\n          autoScaling: {\n            max: 20, // Increase max instances\n          },\n        },\n      },\n    },\n  }\n)\n```\n\n### Composing Presets\n\nCombine multiple presets:\n\n```typescript\nimport { composePresets, createStaticSitePreset, createApiBackendPreset } from 'ts-cloud/presets'\n\nexport default composePresets(\n  createStaticSitePreset({ name: 'Frontend', slug: 'frontend', domain: 'example.com' }),\n  createApiBackendPreset({ name: 'Backend', slug: 'backend' }),\n  {\n    // Custom overrides\n    infrastructure: {\n      monitoring: {\n        alarms: [{ metric: 'Errors', threshold: 10 }],\n      },\n    },\n  }\n)\n```\n\n## Advanced Usage\n\n### Custom CloudFormation\n\nGenerate templates programmatically:\n\n```typescript\nimport { CloudFormationBuilder } from 'ts-cloud/cloudformation'\n\nconst builder = new CloudFormationBuilder(config)\nconst template = builder.build()\n\nconsole.log(JSON.stringify(template, null, 2))\n```\n\n### Direct AWS API Calls\n\nUse the AWS clients directly:\n\n```typescript\nimport { CloudFormationClient, S3Client, CloudFrontClient } from 'ts-cloud/aws'\n\n// CloudFormation\nconst cfn = new CloudFormationClient('us-east-1')\nawait cfn.createStack({\n  stackName: 'my-stack',\n  templateBody: JSON.stringify(template),\n})\n\n// S3\nconst s3 = new S3Client('us-east-1')\nawait s3.putObject({\n  bucket: 'my-bucket',\n  key: 'file.txt',\n  body: 'Hello World',\n})\n\n// CloudFront\nconst cloudfront = new CloudFrontClient()\nawait cloudfront.createInvalidation({\n  distributionId: 'E1234567890',\n  paths: ['/*'],\n})\n```\n\n## DNS Providers\n\nts-cloud supports multiple DNS providers for domain management and SSL certificate validation:\n\n### Cloudflare\n\n1. Log in to your [Cloudflare Dashboard](https://dash.cloudflare.com/)\n2. Go to **My Profile**→**API Tokens** (or visit \u003chttps://dash.cloudflare.com/profile/api-tokens\u003e)\n3. Click **Create Token**\n4. Use the **Edit zone DNS** template, or create a custom token with:\n  - **Permissions**: Zone → DNS → Edit\n  - **Zone Resources**: Include → All zones (or specific zones)\n5. Copy the generated token\n\n```bash\nexport CLOUDFLARE_API_TOKEN=\"your-api-token-here\"\n```\n\n### Porkbun\n\n1. Log in to your [Porkbun Dashboard](https://porkbun.com/account/api)\n2. Enable API access for your domain(s)\n3. Generate an API key pair\n\n```bash\nexport PORKBUN_API_KEY=\"your-api-key\"\nexport PORKBUN_SECRET_KEY=\"your-secret-key\"\n```\n\n### GoDaddy\n\n1. Log in to [GoDaddy Developer Portal](https://developer.godaddy.com/)\n2. Create a new API key\n3. Note both the key and secret\n\n```bash\nexport GODADDY_API_KEY=\"your-api-key\"\nexport GODADDY_API_SECRET=\"your-api-secret\"\nexport GODADDY_ENVIRONMENT=\"production\"  # or \"ote\" for testing\n```\n\n### Route53\n\nUses AWS credentials from environment or ~/.aws/credentials:\n\n```bash\nexport AWS_ACCESS_KEY_ID=\"your-access-key\"\nexport AWS_SECRET_ACCESS_KEY=\"your-secret-key\"\nexport AWS_REGION=\"us-east-1\"\nexport AWS_HOSTED_ZONE_ID=\"Z1234567890\"  # Optional\n```\n\n### CLI Usage\n\n```bash\n# List domains\ncloud domain:list --provider cloudflare\n\n# List DNS records\ncloud dns:records example.com --provider cloudflare\n\n# Add a DNS record\ncloud dns:add example.com A 192.168.1.1 --name api --provider cloudflare\n\n# Generate SSL certificate with DNS validation\ncloud domain:ssl example.com --provider cloudflare\n```\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Run tests\nbun test\n\n# Build\nbun run build\n\n# Type check\nbun run typecheck\n```\n\n## Architecture\n\n### How It Works\n\n1. **Configuration** - Define infrastructure in TypeScript\n2. **CloudFormation Generation** - Convert config to CloudFormation templates\n3. **AWS API Calls** - Direct HTTPS calls to AWS CloudFormation API\n4. **Deployment** - Create/update stacks with change sets\n5. **Monitoring** - Track deployment progress with real-time events\n\n### No Dependencies\n\nts-cloud uses **zero external dependencies** for AWS operations:\n\n- **AWS Signature V4** - Manual request signing for authentication\n- **Direct HTTPS** - Native `fetch()` for API calls\n- **Credentials** - Parse ~/.aws/credentials without SDK\n- **CloudFormation** - XML/JSON parsing for responses\n\nThis means:\n\n- ⚡ Faster startup and execution\n- 📦 Smaller bundle size\n- 🔒 Better security (no supply chain attacks)\n- 🎯 Full control over AWS interactions\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/ts-cloud/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n\"Software that is free, but hopes for a postcard.\" We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/ts-cloud?style=flat-square\n[npm-version-href]: https://npmjs.com/package/ts-cloud\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/ts-cloud/ci.yml?style=flat-square\u0026branch=main\n[github-actions-href]: https://github.com/stacksjs/ts-cloud/actions?query=workflow%3Aci\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/ts-cloud/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/ts-cloud --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fts-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fts-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fts-cloud/lists"}