diff --git a/apps/ops/src/aws/apprunner.ts b/apps/ops/src/aws/apprunner.ts index 1bebe42..1cc7414 100644 --- a/apps/ops/src/aws/apprunner.ts +++ b/apps/ops/src/aws/apprunner.ts @@ -834,7 +834,7 @@ export async function listLetsGoAppRunnerServices( while (true) { const result = await apprunner.send(new ListServicesCommand(listInput)); for (const service of result.ServiceSummaryList || []) { - if (service.ServiceName?.startsWith(VendorPrefix)) { + if (service.ServiceName?.startsWith(`${VendorPrefix}-`)) { const listTagsCommand = new ListTagsForResourceCommand({ ResourceArn: service.ServiceArn || "", }); diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index b13f983..e1c024f 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -11,7 +11,12 @@ import { SQSClient, SendMessageCommand, } from "@aws-sdk/client-sqs"; -import { DefaultRegion, DefaultDeployment, TagKeys } from "@letsgo/constants"; +import { + DefaultRegion, + DefaultDeployment, + TagKeys, + VendorPrefix, +} from "@letsgo/constants"; import { Message } from "@letsgo/types"; import http from "http"; @@ -47,24 +52,27 @@ export async function listLetsGoQueues( while (true) { const result = await sqs.send(new ListQueuesCommand(listInput)); for (const queueUrl of result.QueueUrls || []) { - const listTagsCommand = new ListQueueTagsCommand({ - QueueUrl: queueUrl, - }); - try { - const tagsResult = await sqs.send(listTagsCommand); - const deploymentValue = tagsResult.Tags?.[TagKeys.LetsGoDeployment]; - if ( - deploymentValue && - (!deployment || deployment === deploymentValue) - ) { - queues.push(queueUrl); - } - } catch (e: any) { - if ( - e.name !== "AWS.SimpleQueueService.NonExistentQueue" && - e.name !== "QueueDoesNotExist" - ) { - throw e; + const queueName = queueUrl.split("/").pop(); + if (queueName?.startsWith(`${VendorPrefix}-`)) { + const listTagsCommand = new ListQueueTagsCommand({ + QueueUrl: queueUrl, + }); + try { + const tagsResult = await sqs.send(listTagsCommand); + const deploymentValue = tagsResult.Tags?.[TagKeys.LetsGoDeployment]; + if ( + deploymentValue && + (!deployment || deployment === deploymentValue) + ) { + queues.push(queueUrl); + } + } catch (e: any) { + if ( + e.name !== "AWS.SimpleQueueService.NonExistentQueue" && + e.name !== "QueueDoesNotExist" + ) { + throw e; + } } } }