BunPress Documentation
⌘ K
GuideAPIExamples

Installation

ts-cloud is distributed as an npm package and works best with Bun for optimal performance.

Package Managers

bun add ts-cloud
npm install ts-cloud
pnpm add ts-cloud
yarn add ts-cloud

Requirements

  • Bun (recommended) or Node.js 18+
  • AWS Account with appropriate permissions
  • AWS Credentials configured via environment variables or ~/.aws/credentials

AWS Credentials Setup

ts-cloud needs AWS credentials to deploy infrastructure. You have several options:

export AWS_ACCESS_KEY_ID=your-access-key
export AWS_SECRET_ACCESS_KEY=your-secret-key
export AWS_DEFAULT_REGION=us-east-1

AWS Credentials File

Create or edit ~/.aws/credentials:

[default]
aws_access_key_id = your-access-key
aws_secret_access_key = your-secret-key
region = us-east-1

Using Named Profiles

[production]
aws_access_key_id = prod-access-key
aws_secret_access_key = prod-secret-key
region = us-east-1

[development]
aws_access_key_id = dev-access-key
aws_secret_access_key = dev-secret-key
region = us-west-2

Then set the profile:

export AWS_PROFILE=production

Verify Installation

Create a simple test file:

// test.ts
import { CloudFormationClient } from 'ts-cloud'

const client = new CloudFormationClient('us-east-1')
const stacks = await client.listStacks()
console.log('Connected! Found', stacks.length, 'stacks')

Run it:

bun run test.ts

If you see your stack count, you're ready to go!

Required IAM Permissions

For full ts-cloud functionality, your IAM user/role needs these permissions:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudformation:*",
        "s3:*",
        "cloudfront:*",
        "route53:*",
        "acm:*",
        "ec2:*",
        "ecs:*",
        "rds:*",
        "elasticache:*",
        "lambda:*",
        "apigateway:*",
        "dynamodb:*",
        "sqs:*",
        "sns:*",
        "logs:*",
        "iam:PassRole"
      ],
      "Resource": "*"
    }
  ]
}

TIP

For production, scope these permissions down to only what your infrastructure needs.

Next Steps