1
0

sst.config.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /// <reference path="./.sst/platform/config.d.ts" />
  2. export default $config({
  3. app(input) {
  4. return {
  5. name: "opencode",
  6. removal: input?.stage === "production" ? "retain" : "remove",
  7. protect: ["production"].includes(input?.stage),
  8. home: "cloudflare",
  9. providers: {
  10. aws: {
  11. version: "7.30.0",
  12. region: "us-east-1",
  13. profile: process.env.GITHUB_ACTIONS
  14. ? undefined
  15. : input.stage === "production"
  16. ? "opencode-production"
  17. : "opencode-dev",
  18. },
  19. stripe: {
  20. version: "0.0.28",
  21. apiKey: process.env.STRIPE_SECRET_KEY!,
  22. },
  23. random: "4.19.2",
  24. planetscale: "0.4.1",
  25. honeycomb: "0.49.0",
  26. },
  27. }
  28. },
  29. async run() {
  30. const stage = await import("./infra/stage.js")
  31. await import("./infra/app.js")
  32. if (stage.deployAws) {
  33. await import("./infra/lake.js")
  34. await import("./infra/stats.js")
  35. }
  36. const { stat } = await import("./infra/console.js")
  37. await import("./infra/enterprise.js")
  38. if ($app.stage === "production" || $app.stage === "vimtor") {
  39. await import("./infra/monitoring.js")
  40. }
  41. return {
  42. StatWorkerUrl: stat.url,
  43. // StatsUrl: stats.app.url,
  44. AwsStage: stage.awsStage,
  45. }
  46. },
  47. })