cloudaxe-opencode/sst.config.ts

54 lines
1.5 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) {
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: {
2026-05-26 15:48:27 +00:00
aws: {
version: "7.30.0",
region: "us-east-1",
2026-05-26 15:52:47 +00:00
profile: process.env.GITHUB_ACTIONS
? undefined
: input.stage === "production"
? "opencode-production"
: "opencode-dev",
2026-05-26 15:48:27 +00:00
},
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")
2026-06-02 06:41:33 +00:00
const lake = stage.deployAws ? await import("./infra/lake.js") : undefined
const stats = stage.deployAws ? await import("./infra/stats.js") : undefined
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,
2026-05-28 23:37:13 +00:00
...(stats ? { StatsUrl: stats.app.url } : {}),
2026-06-02 06:41:33 +00:00
...(lake
? {
LakeUrl: lake.lakeIngest.properties.url,
2026-06-02 13:51:59 +00:00
LakeSecretSsm: lake.ingestSecretSsm.name,
2026-06-02 06:41:33 +00:00
}
: {}),
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
})