Skip to content

Commit 9546b0d

Browse files
committed
chore: wip
1 parent c819e41 commit 9546b0d

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.stacks/core/buddy/src/commands/cloud.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export function cloud(buddy: CLI) {
227227
}
228228
}
229229

230-
await outro('Exited', { startTime, useSeconds: true })
230+
log.info('')
231+
await outro('All AWS resources have been removed', { startTime, useSeconds: true })
231232
process.exit(ExitCode.Success)
232233
})
233234

.stacks/core/cloud/src/cloud.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
aws_route53_targets as targets,
2929
aws_wafv2 as wafv2,
3030
} from 'aws-cdk-lib'
31-
import { S3 } from '@aws-sdk/client-s3'
31+
import { ListBucketsCommand, S3 } from '@aws-sdk/client-s3'
3232
import { string } from '@stacksjs/strings'
3333
import { hasFiles } from '@stacksjs/storage'
3434
import { path as p } from '@stacksjs/path'
@@ -984,7 +984,17 @@ export class StacksCloud extends Stack {
984984
}
985985

986986
export async function getBucketWithPrefix(prefix: string): Promise<string | null | undefined> {
987-
const response = await new S3().listBuckets()
988-
const bucket = response.Buckets?.find(bucket => bucket.Name?.startsWith(prefix))
989-
return bucket ? bucket.Name : null
987+
const s3 = new S3({ region: 'us-east-1' })
988+
989+
try {
990+
const response = await s3.send(new ListBucketsCommand({}))
991+
992+
const bucket = response.Buckets?.find(bucket => bucket.Name?.startsWith(prefix))
993+
994+
return bucket ? bucket.Name : null
995+
}
996+
catch (error) {
997+
console.error('Error fetching buckets', error)
998+
throw error
999+
}
9901000
}

.stacks/core/dns/src/drivers/aws.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ export async function updateNameservers(hostedZoneNameservers: string[], domainN
182182
return
183183
}
184184

185-
log.info('Your nameservers are up to date.')
185+
log.info('')
186+
log.info('✅ Your nameservers are up to date.')
186187
}
187188

188189
// please note, this function also updates the user's nameservers if they are out of date

0 commit comments

Comments
 (0)