fix: stuck sst deployment
This commit is contained in:
parent
1bf2b298e9
commit
541a25c2a1
4 changed files with 42 additions and 22 deletions
27
infra/lake-destroy-prep.ts
Normal file
27
infra/lake-destroy-prep.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Temporary destroy prep: keep only non-empty resources declared so SST updates forceDestroy before omission.
|
||||||
|
new aws.s3tables.TableBucket("LakeTableBucket", {
|
||||||
|
name: `opencode-${$app.stage}-lake`,
|
||||||
|
forceDestroy: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
const athenaResultsBucket = new aws.s3.Bucket("LakeAthenaResults", {
|
||||||
|
bucket: `opencode-${$app.stage}-lake-athena-results`,
|
||||||
|
forceDestroy: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
new aws.s3.Bucket("LakeFirehoseErrors", {
|
||||||
|
bucket: `opencode-${$app.stage}-lake-firehose-errors`,
|
||||||
|
forceDestroy: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
new aws.athena.Workgroup("LakeAthenaWorkgroup", {
|
||||||
|
name: `opencode-${$app.stage}-lake-workgroup`,
|
||||||
|
forceDestroy: true,
|
||||||
|
configuration: {
|
||||||
|
enforceWorkgroupConfiguration: true,
|
||||||
|
publishCloudwatchMetricsEnabled: true,
|
||||||
|
resultConfiguration: {
|
||||||
|
outputLocation: $interpolate`s3://${athenaResultsBucket.bucket}/`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -7,9 +7,9 @@ export const domain = (() => {
|
||||||
export const zoneID = "430ba34c138cfb5360826c4909f99be8"
|
export const zoneID = "430ba34c138cfb5360826c4909f99be8"
|
||||||
// Dev owns the shared AWS lake/stats infra for all non-production stages.
|
// Dev owns the shared AWS lake/stats infra for all non-production stages.
|
||||||
export const awsStage = $app.stage === "production" ? "production" : "dev"
|
export const awsStage = $app.stage === "production" ? "production" : "dev"
|
||||||
// TODO temporarily disable AWS infra deployment
|
export const prepareAwsDestroy = $app.stage === "production" || $app.stage === "dev"
|
||||||
|
// Temporarily omit AWS infra so SST removes the lake/stats resources.
|
||||||
export const deployAws = false
|
export const deployAws = false
|
||||||
//export const deployAws = $app.stage === awsStage
|
|
||||||
|
|
||||||
new cloudflare.RegionalHostname("RegionalHostname", {
|
new cloudflare.RegionalHostname("RegionalHostname", {
|
||||||
hostname: domain,
|
hostname: domain,
|
||||||
|
|
|
||||||
2
sst-env.d.ts
vendored
2
sst-env.d.ts
vendored
|
|
@ -344,4 +344,4 @@ declare module "sst" {
|
||||||
}
|
}
|
||||||
|
|
||||||
import "sst"
|
import "sst"
|
||||||
export {}
|
export {}
|
||||||
|
|
|
||||||
|
|
@ -2,30 +2,20 @@
|
||||||
|
|
||||||
export default $config({
|
export default $config({
|
||||||
app(input) {
|
app(input) {
|
||||||
// Dev owns the shared AWS lake/stats infra for all non-production stages.
|
const prepareAwsDestroy = input.stage === "production" || input.stage === "dev"
|
||||||
const awsStage = input.stage === "production" ? "production" : "dev"
|
// Temporarily omit AWS infra so SST removes the lake/stats resources.
|
||||||
// TODO temporarily disable AWS infra deployment
|
|
||||||
const deployAws = false
|
const deployAws = false
|
||||||
//const deployAws = input.stage === awsStage
|
|
||||||
return {
|
return {
|
||||||
name: "opencode",
|
name: "opencode",
|
||||||
removal: input?.stage === "production" ? "retain" : "remove",
|
removal: input?.stage === "production" ? "retain" : "remove",
|
||||||
protect: ["production"].includes(input?.stage),
|
protect: ["production"].includes(input?.stage),
|
||||||
home: "cloudflare",
|
home: "cloudflare",
|
||||||
providers: {
|
providers: {
|
||||||
...(deployAws
|
aws: {
|
||||||
? {
|
version: "7.30.0",
|
||||||
aws: {
|
region: "us-east-1",
|
||||||
version: "7.30.0",
|
profile: process.env.GITHUB_ACTIONS ? undefined : input.stage === "production" ? "opencode-production" : "opencode-dev",
|
||||||
region: "us-east-1",
|
},
|
||||||
profile: process.env.GITHUB_ACTIONS
|
|
||||||
? undefined
|
|
||||||
: input.stage === "production"
|
|
||||||
? "opencode-production"
|
|
||||||
: "opencode-dev",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: {}),
|
|
||||||
stripe: {
|
stripe: {
|
||||||
version: "0.0.28",
|
version: "0.0.28",
|
||||||
apiKey: process.env.STRIPE_SECRET_KEY!,
|
apiKey: process.env.STRIPE_SECRET_KEY!,
|
||||||
|
|
@ -39,9 +29,12 @@ export default $config({
|
||||||
async run() {
|
async run() {
|
||||||
const stage = await import("./infra/stage.js")
|
const stage = await import("./infra/stage.js")
|
||||||
await import("./infra/app.js")
|
await import("./infra/app.js")
|
||||||
|
if (stage.prepareAwsDestroy) {
|
||||||
|
await import("./infra/lake-destroy-prep.js")
|
||||||
|
}
|
||||||
if (stage.deployAws) {
|
if (stage.deployAws) {
|
||||||
//await import("./infra/lake.js")
|
await import("./infra/lake.js")
|
||||||
//await import("./infra/stats.js")
|
await import("./infra/stats.js")
|
||||||
}
|
}
|
||||||
const { stat } = await import("./infra/console.js")
|
const { stat } = await import("./infra/console.js")
|
||||||
await import("./infra/enterprise.js")
|
await import("./infra/enterprise.js")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue