@stacksjs/ts-cloud 0.1.9 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -377
- package/dist/bin/cli.js +1047 -424
- package/dist/index.d.ts +36 -3
- package/dist/index.js +76430 -7096
- package/package.json +7 -8
- package/dist/aws/acm.d.ts +0 -129
- package/dist/aws/application-autoscaling.d.ts +0 -282
- package/dist/aws/bedrock.d.ts +0 -2292
- package/dist/aws/client.d.ts +0 -79
- package/dist/aws/cloudformation.d.ts +0 -105
- package/dist/aws/cloudfront.d.ts +0 -265
- package/dist/aws/cloudwatch-logs.d.ts +0 -48
- package/dist/aws/comprehend.d.ts +0 -505
- package/dist/aws/connect.d.ts +0 -377
- package/dist/aws/deploy-imap.d.ts +0 -14
- package/dist/aws/dynamodb.d.ts +0 -176
- package/dist/aws/ec2.d.ts +0 -272
- package/dist/aws/ecr.d.ts +0 -149
- package/dist/aws/ecs.d.ts +0 -162
- package/dist/aws/elasticache.d.ts +0 -71
- package/dist/aws/elbv2.d.ts +0 -248
- package/dist/aws/email.d.ts +0 -175
- package/dist/aws/eventbridge.d.ts +0 -142
- package/dist/aws/iam.d.ts +0 -638
- package/dist/aws/imap-server.d.ts +0 -119
- package/dist/aws/index.d.ts +0 -192
- package/dist/aws/kendra.d.ts +0 -782
- package/dist/aws/lambda.d.ts +0 -232
- package/dist/aws/opensearch.d.ts +0 -87
- package/dist/aws/personalize.d.ts +0 -516
- package/dist/aws/polly.d.ts +0 -214
- package/dist/aws/rds.d.ts +0 -240
- package/dist/aws/rekognition.d.ts +0 -543
- package/dist/aws/route53-domains.d.ts +0 -113
- package/dist/aws/route53.d.ts +0 -215
- package/dist/aws/s3.d.ts +0 -212
- package/dist/aws/scheduler.d.ts +0 -140
- package/dist/aws/secrets-manager.d.ts +0 -170
- package/dist/aws/ses.d.ts +0 -288
- package/dist/aws/setup-phone.d.ts +0 -0
- package/dist/aws/setup-sms.d.ts +0 -115
- package/dist/aws/sms.d.ts +0 -304
- package/dist/aws/smtp-server.d.ts +0 -61
- package/dist/aws/sns.d.ts +0 -117
- package/dist/aws/sqs.d.ts +0 -65
- package/dist/aws/ssm.d.ts +0 -179
- package/dist/aws/sts.d.ts +0 -15
- package/dist/aws/support.d.ts +0 -104
- package/dist/aws/test-imap.d.ts +0 -0
- package/dist/aws/textract.d.ts +0 -403
- package/dist/aws/transcribe.d.ts +0 -60
- package/dist/aws/translate.d.ts +0 -358
- package/dist/aws/voice.d.ts +0 -219
- package/dist/config.d.ts +0 -7
- package/dist/deploy/index.d.ts +0 -2
- package/dist/deploy/static-site-external-dns.d.ts +0 -51
- package/dist/deploy/static-site.d.ts +0 -71
- package/dist/dns/cloudflare.d.ts +0 -52
- package/dist/dns/godaddy.d.ts +0 -38
- package/dist/dns/index.d.ts +0 -45
- package/dist/dns/porkbun.d.ts +0 -18
- package/dist/dns/route53-adapter.d.ts +0 -38
- package/dist/dns/types.d.ts +0 -77
- package/dist/dns/validator.d.ts +0 -78
- package/dist/generators/index.d.ts +0 -1
- package/dist/generators/infrastructure.d.ts +0 -30
- package/dist/push/apns.d.ts +0 -60
- package/dist/push/fcm.d.ts +0 -117
- package/dist/push/index.d.ts +0 -14
- package/dist/security/pre-deploy-scanner.d.ts +0 -69
- package/dist/ssl/acme-client.d.ts +0 -67
- package/dist/ssl/index.d.ts +0 -2
- package/dist/ssl/letsencrypt.d.ts +0 -48
- package/dist/types.d.ts +0 -1
- package/dist/utils/cli.d.ts +0 -123
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/template.d.ts +0 -23
- package/src/aws/acm.ts +0 -768
- package/src/aws/application-autoscaling.ts +0 -845
- package/src/aws/bedrock.ts +0 -4074
- package/src/aws/client.ts +0 -891
- package/src/aws/cloudformation.ts +0 -896
- package/src/aws/cloudfront.ts +0 -1531
- package/src/aws/cloudwatch-logs.ts +0 -154
- package/src/aws/comprehend.ts +0 -839
- package/src/aws/connect.ts +0 -1056
- package/src/aws/deploy-imap.ts +0 -384
- package/src/aws/dynamodb.ts +0 -340
- package/src/aws/ec2.ts +0 -1385
- package/src/aws/ecr.ts +0 -621
- package/src/aws/ecs.ts +0 -615
- package/src/aws/elasticache.ts +0 -301
- package/src/aws/elbv2.ts +0 -942
- package/src/aws/email.ts +0 -928
- package/src/aws/eventbridge.ts +0 -248
- package/src/aws/iam.ts +0 -1689
- package/src/aws/imap-server.ts +0 -2100
- package/src/aws/index.ts +0 -213
- package/src/aws/kendra.ts +0 -1097
- package/src/aws/lambda.ts +0 -786
- package/src/aws/opensearch.ts +0 -158
- package/src/aws/personalize.ts +0 -977
- package/src/aws/polly.ts +0 -559
- package/src/aws/rds.ts +0 -888
- package/src/aws/rekognition.ts +0 -846
- package/src/aws/route53-domains.ts +0 -359
- package/src/aws/route53.ts +0 -1046
- package/src/aws/s3.ts +0 -2334
- package/src/aws/scheduler.ts +0 -571
- package/src/aws/secrets-manager.ts +0 -769
- package/src/aws/ses.ts +0 -1081
- package/src/aws/setup-phone.ts +0 -104
- package/src/aws/setup-sms.ts +0 -580
- package/src/aws/sms.ts +0 -1735
- package/src/aws/smtp-server.ts +0 -531
- package/src/aws/sns.ts +0 -758
- package/src/aws/sqs.ts +0 -382
- package/src/aws/ssm.ts +0 -807
- package/src/aws/sts.ts +0 -92
- package/src/aws/support.ts +0 -391
- package/src/aws/test-imap.ts +0 -86
- package/src/aws/textract.ts +0 -780
- package/src/aws/transcribe.ts +0 -108
- package/src/aws/translate.ts +0 -641
- package/src/aws/voice.ts +0 -1379
- package/src/config.ts +0 -35
- package/src/deploy/index.ts +0 -7
- package/src/deploy/static-site-external-dns.ts +0 -945
- package/src/deploy/static-site.ts +0 -1175
- package/src/dns/cloudflare.ts +0 -548
- package/src/dns/godaddy.ts +0 -412
- package/src/dns/index.ts +0 -205
- package/src/dns/porkbun.ts +0 -362
- package/src/dns/route53-adapter.ts +0 -414
- package/src/dns/types.ts +0 -119
- package/src/dns/validator.ts +0 -369
- package/src/generators/index.ts +0 -5
- package/src/generators/infrastructure.ts +0 -1660
- package/src/index.ts +0 -163
- package/src/push/apns.ts +0 -452
- package/src/push/fcm.ts +0 -506
- package/src/push/index.ts +0 -58
- package/src/security/pre-deploy-scanner.ts +0 -655
- package/src/ssl/acme-client.ts +0 -478
- package/src/ssl/index.ts +0 -7
- package/src/ssl/letsencrypt.ts +0 -747
- package/src/types.ts +0 -2
- package/src/utils/cli.ts +0 -398
- package/src/validation/index.ts +0 -5
- package/src/validation/template.ts +0 -405
package/README.md
CHANGED
|
@@ -1,406 +1,68 @@
|
|
|
1
|
-
<p align="center"><img src=".github/art/cover.jpg" alt="Social Card of this repo"></p>
|
|
2
|
-
|
|
3
|
-
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
-
[![GitHub Actions][github-actions-src]][github-actions-href]
|
|
5
|
-
[](http://commitizen.github.io/cz-cli/)
|
|
6
|
-
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
|
|
7
|
-
<!-- [![Codecov][codecov-src]][codecov-href] -->
|
|
8
|
-
|
|
9
1
|
# @stacksjs/ts-cloud
|
|
10
2
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
@stacksjs/ts-cloud is a modern infrastructure-as-code framework that lets you define AWS infrastructure using TypeScript configuration files. Unlike AWS CDK or Terraform, @stacksjs/ts-cloud:
|
|
16
|
-
|
|
17
|
-
- **Zero AWS Dependencies** - No AWS SDK, no AWS CLI. Direct AWS API calls only.
|
|
18
|
-
- **Type-Safe Configuration** - Full TypeScript types for all AWS resources
|
|
19
|
-
- **Production-Ready Presets** - 13 battle-tested infrastructure templates
|
|
20
|
-
- **Bun-Powered** - Lightning-fast builds and deployments
|
|
21
|
-
- **CloudFormation Native** - Generate clean, reviewable CloudFormation templates
|
|
22
|
-
|
|
23
|
-
## Features
|
|
24
|
-
|
|
25
|
-
### 🚀 Configuration Presets
|
|
26
|
-
|
|
27
|
-
Skip the boilerplate with production-ready presets for common architectures:
|
|
28
|
-
|
|
29
|
-
- **Static Sites** - S3 + CloudFront for SPAs and static websites
|
|
30
|
-
- **Node.js Servers** - EC2 + ALB + RDS + Redis for traditional apps
|
|
31
|
-
- **Serverless Apps** - ECS Fargate + ALB + DynamoDB for scalable services
|
|
32
|
-
- **Full-Stack Apps** - Complete frontend + backend + database stack
|
|
33
|
-
- **API Backends** - API Gateway + Lambda + DynamoDB for serverless APIs
|
|
34
|
-
- **WordPress** - Optimized WordPress hosting with RDS + EFS + CloudFront
|
|
35
|
-
- **JAMstack** - Modern static sites with Lambda@Edge for SSR
|
|
36
|
-
- **Microservices** - Multi-service architecture with service discovery
|
|
37
|
-
- **Real-time Apps** - WebSocket API + Lambda + DynamoDB Streams
|
|
38
|
-
- **Data Pipelines** - Kinesis + Lambda + S3 + Athena + Glue for ETL
|
|
39
|
-
- **ML APIs** - SageMaker + API Gateway for ML inference
|
|
40
|
-
- **Traditional Web Apps** - Session-based apps with EFS + Redis + ALB
|
|
41
|
-
|
|
42
|
-
### 🛠️ Infrastructure Builders
|
|
43
|
-
|
|
44
|
-
Complete CloudFormation template builders for:
|
|
45
|
-
|
|
46
|
-
- **Network** - VPC, subnets, NAT gateways, routing, security groups
|
|
47
|
-
- **Storage** - S3 buckets with versioning, encryption, lifecycle rules, EFS
|
|
48
|
-
- **Compute** - EC2 Auto Scaling, ECS Fargate, Lambda functions
|
|
49
|
-
- **Database** - RDS (PostgreSQL/MySQL), DynamoDB with streams and GSIs
|
|
50
|
-
- **Cache** - ElastiCache Redis/Memcached with replication
|
|
51
|
-
- **CDN** - CloudFront distributions with custom domains and Lambda@Edge
|
|
52
|
-
- **API Gateway** - HTTP, REST, and WebSocket APIs
|
|
53
|
-
- **Queue** - SQS queues with dead letter queues
|
|
54
|
-
- **Messaging** - SNS topics and subscriptions
|
|
55
|
-
- **Monitoring** - CloudWatch dashboards, alarms, and log groups
|
|
56
|
-
- **Security** - ACM certificates, WAF rules, security groups
|
|
57
|
-
|
|
58
|
-
### 🔒 Pre-Deployment Security Scanning
|
|
59
|
-
|
|
60
|
-
Built-in secret detection to prevent accidental credential exposure:
|
|
61
|
-
|
|
62
|
-
- **35+ Secret Patterns** - AWS keys, API tokens, private keys, database credentials
|
|
63
|
-
- **Automatic Scanning** - Runs before every deployment
|
|
64
|
-
- **Configurable Severity** - Block on critical, high, medium, or low findings
|
|
65
|
-
- **CI/CD Ready** - Integrate security checks into your pipeline
|
|
3
|
+
A lightweight, performant infrastructure-as-code library and CLI for deploying both server-based (EC2) and serverless applications on AWS.
|
|
66
4
|
|
|
67
|
-
|
|
68
|
-
# Scan for secrets before deploying
|
|
69
|
-
cloud deploy:security-scan --source ./dist
|
|
70
|
-
|
|
71
|
-
# Deploy with automatic security scanning
|
|
72
|
-
cloud deploy # Scans automatically before deployment
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### ☁️ Direct AWS Integration
|
|
76
|
-
|
|
77
|
-
No SDK, no CLI - pure AWS Signature V4 API calls:
|
|
78
|
-
|
|
79
|
-
- **CloudFormation** - CreateStack, UpdateStack, DeleteStack, DescribeStacks
|
|
80
|
-
- **S3** - PutObject, multipart upload, sync directory
|
|
81
|
-
- **CloudFront** - Cache invalidations with wait support
|
|
82
|
-
- **Credentials** - Resolve from env vars, ~/.aws/credentials, or IAM roles
|
|
83
|
-
|
|
84
|
-
## Quick Start
|
|
85
|
-
|
|
86
|
-
### Installation
|
|
5
|
+
## Installation
|
|
87
6
|
|
|
88
7
|
```bash
|
|
89
8
|
bun add @stacksjs/ts-cloud
|
|
90
9
|
```
|
|
91
10
|
|
|
92
|
-
### Your First Deployment
|
|
93
|
-
|
|
94
|
-
Create a `cloud.config.ts`:
|
|
95
|
-
|
|
96
|
-
```typescript
|
|
97
|
-
import { createStaticSitePreset } from '@stacksjs/ts-cloud/presets'
|
|
98
|
-
|
|
99
|
-
export default createStaticSitePreset({
|
|
100
|
-
name: 'My Website',
|
|
101
|
-
slug: 'my-website',
|
|
102
|
-
domain: 'example.com',
|
|
103
|
-
})
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Deploy:
|
|
107
|
-
|
|
108
11
|
```bash
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
That's it! You now have:
|
|
113
|
-
|
|
114
|
-
- ✅ S3 bucket with static website hosting
|
|
115
|
-
- ✅ CloudFront CDN with HTTPS
|
|
116
|
-
- ✅ Route53 DNS configuration
|
|
117
|
-
- ✅ ACM SSL certificate
|
|
118
|
-
|
|
119
|
-
### More Examples
|
|
120
|
-
|
|
121
|
-
#### Full-Stack Application
|
|
122
|
-
|
|
123
|
-
```typescript
|
|
124
|
-
import { createFullStackAppPreset } from '@stacksjs/ts-cloud/presets'
|
|
125
|
-
|
|
126
|
-
export default createFullStackAppPreset({
|
|
127
|
-
name: 'My App',
|
|
128
|
-
slug: 'my-app',
|
|
129
|
-
domain: 'app.example.com',
|
|
130
|
-
apiSubdomain: 'api.example.com',
|
|
131
|
-
})
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Includes:
|
|
135
|
-
|
|
136
|
-
- Frontend: S3 + CloudFront
|
|
137
|
-
- Backend: ECS Fargate with auto-scaling
|
|
138
|
-
- Database: PostgreSQL RDS with Multi-AZ
|
|
139
|
-
- Cache: Redis ElastiCache
|
|
140
|
-
- Queue: SQS for background jobs
|
|
141
|
-
|
|
142
|
-
#### Serverless API
|
|
143
|
-
|
|
144
|
-
```typescript
|
|
145
|
-
import { createApiBackendPreset } from '@stacksjs/ts-cloud/presets'
|
|
146
|
-
|
|
147
|
-
export default createApiBackendPreset({
|
|
148
|
-
name: 'My API',
|
|
149
|
-
slug: 'my-api',
|
|
150
|
-
domain: 'api.example.com',
|
|
151
|
-
})
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Includes:
|
|
155
|
-
|
|
156
|
-
- API Gateway HTTP API
|
|
157
|
-
- Lambda functions with auto-scaling
|
|
158
|
-
- DynamoDB tables with on-demand billing
|
|
159
|
-
- CloudWatch monitoring and alarms
|
|
160
|
-
|
|
161
|
-
## Configuration
|
|
162
|
-
|
|
163
|
-
### Extending Presets
|
|
164
|
-
|
|
165
|
-
You can extend any preset with custom configuration:
|
|
166
|
-
|
|
167
|
-
```typescript
|
|
168
|
-
import { createNodeJsServerPreset, extendPreset } from '@stacksjs/ts-cloud/presets'
|
|
169
|
-
|
|
170
|
-
export default extendPreset(
|
|
171
|
-
createNodeJsServerPreset({
|
|
172
|
-
name: 'My App',
|
|
173
|
-
slug: 'my-app',
|
|
174
|
-
}),
|
|
175
|
-
{
|
|
176
|
-
infrastructure: {
|
|
177
|
-
compute: {
|
|
178
|
-
server: {
|
|
179
|
-
instanceType: 't3.large', // Upgrade instance type
|
|
180
|
-
autoScaling: {
|
|
181
|
-
max: 20, // Increase max instances
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Composing Presets
|
|
191
|
-
|
|
192
|
-
Combine multiple presets:
|
|
193
|
-
|
|
194
|
-
```typescript
|
|
195
|
-
import { composePresets, createStaticSitePreset, createApiBackendPreset } from '@stacksjs/ts-cloud/presets'
|
|
196
|
-
|
|
197
|
-
export default composePresets(
|
|
198
|
-
createStaticSitePreset({ name: 'Frontend', slug: 'frontend', domain: 'example.com' }),
|
|
199
|
-
createApiBackendPreset({ name: 'Backend', slug: 'backend' }),
|
|
200
|
-
{
|
|
201
|
-
// Custom overrides
|
|
202
|
-
infrastructure: {
|
|
203
|
-
monitoring: {
|
|
204
|
-
alarms: [{ metric: 'Errors', threshold: 10 }],
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
}
|
|
208
|
-
)
|
|
12
|
+
npm install @stacksjs/ts-cloud
|
|
209
13
|
```
|
|
210
14
|
|
|
211
|
-
##
|
|
212
|
-
|
|
213
|
-
### Custom CloudFormation
|
|
214
|
-
|
|
215
|
-
Generate templates programmatically:
|
|
216
|
-
|
|
217
|
-
```typescript
|
|
218
|
-
import { CloudFormationBuilder } from '@stacksjs/ts-cloud/cloudformation'
|
|
219
|
-
|
|
220
|
-
const builder = new CloudFormationBuilder(config)
|
|
221
|
-
const template = builder.build()
|
|
222
|
-
|
|
223
|
-
console.log(JSON.stringify(template, null, 2))
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Direct AWS API Calls
|
|
227
|
-
|
|
228
|
-
Use the AWS clients directly:
|
|
15
|
+
## Usage
|
|
229
16
|
|
|
230
17
|
```typescript
|
|
231
|
-
import {
|
|
232
|
-
|
|
233
|
-
// CloudFormation
|
|
234
|
-
const cfn = new CloudFormationClient('us-east-1')
|
|
235
|
-
await cfn.createStack({
|
|
236
|
-
stackName: 'my-stack',
|
|
237
|
-
templateBody: JSON.stringify(template),
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
// S3
|
|
241
|
-
const s3 = new S3Client('us-east-1')
|
|
242
|
-
await s3.putObject({
|
|
243
|
-
bucket: 'my-bucket',
|
|
244
|
-
key: 'file.txt',
|
|
245
|
-
body: 'Hello World',
|
|
246
|
-
})
|
|
18
|
+
import { defineStack } from '@stacksjs/ts-cloud'
|
|
247
19
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
20
|
+
const stack = defineStack({
|
|
21
|
+
name: 'my-app',
|
|
22
|
+
resources: {
|
|
23
|
+
// Define your infrastructure
|
|
24
|
+
},
|
|
253
25
|
})
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## DNS Providers
|
|
257
|
-
|
|
258
|
-
@stacksjs/ts-cloud supports multiple DNS providers for domain management and SSL certificate validation:
|
|
259
|
-
|
|
260
|
-
### Cloudflare
|
|
261
|
-
|
|
262
|
-
1. Log in to your [Cloudflare Dashboard](https://dash.cloudflare.com/)
|
|
263
|
-
2. Go to **My Profile** → **API Tokens** (or visit https://dash.cloudflare.com/profile/api-tokens)
|
|
264
|
-
3. Click **Create Token**
|
|
265
|
-
4. Use the **Edit zone DNS** template, or create a custom token with:
|
|
266
|
-
- **Permissions**: Zone → DNS → Edit
|
|
267
|
-
- **Zone Resources**: Include → All zones (or specific zones)
|
|
268
|
-
5. Copy the generated token
|
|
269
|
-
|
|
270
|
-
```bash
|
|
271
|
-
export CLOUDFLARE_API_TOKEN="your-api-token-here"
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Porkbun
|
|
275
|
-
|
|
276
|
-
1. Log in to your [Porkbun Dashboard](https://porkbun.com/account/api)
|
|
277
|
-
2. Enable API access for your domain(s)
|
|
278
|
-
3. Generate an API key pair
|
|
279
|
-
|
|
280
|
-
```bash
|
|
281
|
-
export PORKBUN_API_KEY="your-api-key"
|
|
282
|
-
export PORKBUN_SECRET_KEY="your-secret-key"
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### GoDaddy
|
|
286
|
-
|
|
287
|
-
1. Log in to [GoDaddy Developer Portal](https://developer.godaddy.com/)
|
|
288
|
-
2. Create a new API key
|
|
289
|
-
3. Note both the key and secret
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
export GODADDY_API_KEY="your-api-key"
|
|
293
|
-
export GODADDY_API_SECRET="your-api-secret"
|
|
294
|
-
export GODADDY_ENVIRONMENT="production" # or "ote" for testing
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
### Route53
|
|
298
26
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
export AWS_ACCESS_KEY_ID="your-access-key"
|
|
303
|
-
export AWS_SECRET_ACCESS_KEY="your-secret-key"
|
|
304
|
-
export AWS_REGION="us-east-1"
|
|
305
|
-
export AWS_HOSTED_ZONE_ID="Z1234567890" # Optional
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
### CLI Usage
|
|
309
|
-
|
|
310
|
-
```bash
|
|
311
|
-
# List domains
|
|
312
|
-
cloud domain:list --provider cloudflare
|
|
313
|
-
|
|
314
|
-
# List DNS records
|
|
315
|
-
cloud dns:records example.com --provider cloudflare
|
|
316
|
-
|
|
317
|
-
# Add a DNS record
|
|
318
|
-
cloud dns:add example.com A 192.168.1.1 --name api --provider cloudflare
|
|
319
|
-
|
|
320
|
-
# Generate SSL certificate with DNS validation
|
|
321
|
-
cloud domain:ssl example.com --provider cloudflare
|
|
27
|
+
// Deploy the stack
|
|
28
|
+
await stack.deploy()
|
|
322
29
|
```
|
|
323
30
|
|
|
324
|
-
|
|
31
|
+
### CLI
|
|
325
32
|
|
|
326
33
|
```bash
|
|
327
|
-
#
|
|
328
|
-
|
|
34
|
+
# Initialize a new project
|
|
35
|
+
cloud init
|
|
329
36
|
|
|
330
|
-
#
|
|
331
|
-
|
|
37
|
+
# Deploy your stack
|
|
38
|
+
cloud stack deploy
|
|
332
39
|
|
|
333
|
-
#
|
|
334
|
-
|
|
40
|
+
# Manage resources
|
|
41
|
+
cloud database status
|
|
42
|
+
cloud cdn invalidate
|
|
43
|
+
cloud storage list
|
|
44
|
+
cloud secrets set MY_SECRET value
|
|
335
45
|
|
|
336
|
-
#
|
|
337
|
-
|
|
46
|
+
# Monitoring & logs
|
|
47
|
+
cloud logs tail --stack my-app
|
|
48
|
+
cloud cost estimate
|
|
49
|
+
cloud status
|
|
338
50
|
```
|
|
339
51
|
|
|
340
|
-
##
|
|
341
|
-
|
|
342
|
-
### How It Works
|
|
343
|
-
|
|
344
|
-
1. **Configuration** - Define infrastructure in TypeScript
|
|
345
|
-
2. **CloudFormation Generation** - Convert config to CloudFormation templates
|
|
346
|
-
3. **AWS API Calls** - Direct HTTPS calls to AWS CloudFormation API
|
|
347
|
-
4. **Deployment** - Create/update stacks with change sets
|
|
348
|
-
5. **Monitoring** - Track deployment progress with real-time events
|
|
349
|
-
|
|
350
|
-
### No Dependencies
|
|
351
|
-
|
|
352
|
-
@stacksjs/ts-cloud uses **zero external dependencies** for AWS operations:
|
|
353
|
-
|
|
354
|
-
- **AWS Signature V4** - Manual request signing for authentication
|
|
355
|
-
- **Direct HTTPS** - Native `fetch()` for API calls
|
|
356
|
-
- **Credentials** - Parse ~/.aws/credentials without SDK
|
|
357
|
-
- **CloudFormation** - XML/JSON parsing for responses
|
|
358
|
-
|
|
359
|
-
This means:
|
|
360
|
-
|
|
361
|
-
- ⚡ Faster startup and execution
|
|
362
|
-
- 📦 Smaller bundle size
|
|
363
|
-
- 🔒 Better security (no supply chain attacks)
|
|
364
|
-
- 🎯 Full control over AWS interactions
|
|
365
|
-
|
|
366
|
-
## Contributing
|
|
367
|
-
|
|
368
|
-
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
|
|
369
|
-
|
|
370
|
-
## Community
|
|
371
|
-
|
|
372
|
-
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
373
|
-
|
|
374
|
-
[Discussions on GitHub](https://github.com/stacksjs/ts-cloud/discussions)
|
|
375
|
-
|
|
376
|
-
For casual chit-chat with others using this package:
|
|
377
|
-
|
|
378
|
-
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
|
|
379
|
-
|
|
380
|
-
## Postcardware
|
|
381
|
-
|
|
382
|
-
"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.
|
|
383
|
-
|
|
384
|
-
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
|
|
385
|
-
|
|
386
|
-
## Sponsors
|
|
387
|
-
|
|
388
|
-
We 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.
|
|
52
|
+
## Features
|
|
389
53
|
|
|
390
|
-
-
|
|
391
|
-
-
|
|
54
|
+
- TypeScript-first infrastructure as code
|
|
55
|
+
- Full AWS CloudFormation support with type safety
|
|
56
|
+
- CLI for managing deployments, databases, CDN, storage, secrets, and more
|
|
57
|
+
- Server-based (EC2) and serverless deployment support
|
|
58
|
+
- DNS and SSL management
|
|
59
|
+
- Container and registry support
|
|
60
|
+
- Event-driven architecture (EventBridge, SNS, SQS)
|
|
61
|
+
- Scheduler, notifications, and email integration
|
|
62
|
+
- Environment and team management
|
|
63
|
+
- Cost estimation and analytics
|
|
64
|
+
- Cross-platform compiled binaries (Linux, macOS, Windows)
|
|
392
65
|
|
|
393
66
|
## License
|
|
394
67
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
Made with 💙
|
|
398
|
-
|
|
399
|
-
<!-- Badges -->
|
|
400
|
-
[npm-version-src]: https://img.shields.io/npm/v/@stacksjs/ts-cloud?style=flat-square
|
|
401
|
-
[npm-version-href]: https://npmjs.com/package/@stacksjs/ts-cloud
|
|
402
|
-
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/ts-cloud/ci.yml?style=flat-square&branch=main
|
|
403
|
-
[github-actions-href]: https://github.com/stacksjs/ts-cloud/actions?query=workflow%3Aci
|
|
404
|
-
|
|
405
|
-
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/ts-cloud/main?style=flat-square
|
|
406
|
-
[codecov-href]: https://codecov.io/gh/stacksjs/ts-cloud -->
|
|
68
|
+
MIT
|