cloudaxe-opencode/sst.config.ts

59 lines
1.7 KiB
TypeScript
Raw Normal View History

2025-05-23 18:17:45 +00:00
/// <reference path="./.sst/platform/config.d.ts" />
2025-09-26 11:54:30 +00:00
2025-05-23 18:17:45 +00:00
export default $config({
app(input) {
2026-05-25 23:14:39 +00:00
// Dev owns the shared AWS lake/stats infra for all non-production stages.
const awsStage = input.stage === "production" ? "production" : "dev"
2026-05-26 14:11:41 +00:00
// TODO temporarily disable AWS infra deployment
const deployAws = false
//const deployAws = input.stage === awsStage
2025-05-23 18:17:45 +00:00
return {
name: "opencode",
removal: input?.stage === "production" ? "retain" : "remove",
protect: ["production"].includes(input?.stage),
home: "cloudflare",
2025-08-08 17:22:54 +00:00
providers: {
...(deployAws
? {
aws: {
version: "7.30.0",
region: "us-east-1",
profile: process.env.GITHUB_ACTIONS
? undefined
: input.stage === "production"
? "opencode-production"
: "opencode-dev",
},
}
: {}),
2025-08-08 17:22:54 +00:00
stripe: {
2026-05-21 15:19:15 +00:00
version: "0.0.28",
2025-11-23 19:28:10 +00:00
apiKey: process.env.STRIPE_SECRET_KEY!,
2025-08-08 17:22:54 +00:00
},
random: "4.19.2",
2025-09-02 07:14:56 +00:00
planetscale: "0.4.1",
honeycomb: "0.49.0",
2025-08-08 17:22:54 +00:00
},
2025-09-03 00:01:11 +00:00
}
2025-05-23 18:17:45 +00:00
},
async run() {
const stage = await import("./infra/stage.js")
2025-09-15 07:53:21 +00:00
await import("./infra/app.js")
if (stage.deployAws) {
2026-05-26 14:11:41 +00:00
//await import("./infra/lake.js")
//await import("./infra/stats.js")
}
2026-05-13 01:37:34 +00:00
const { stat } = await import("./infra/console.js")
2025-11-23 19:31:03 +00:00
await import("./infra/enterprise.js")
if ($app.stage === "production" || $app.stage === "vimtor") {
await import("./infra/monitoring.js")
}
2026-05-13 01:37:34 +00:00
return {
2026-05-13 03:19:23 +00:00
StatWorkerUrl: stat.url,
// StatsUrl: stats.app.url,
2026-05-25 23:14:39 +00:00
AwsStage: stage.awsStage,
2026-05-13 01:37:34 +00:00
}
2025-05-23 18:17:45 +00:00
},
2025-09-03 00:01:11 +00:00
})