From 2311f2879533b08e30063dda98c47379c0485486 Mon Sep 17 00:00:00 2001 From: Timothy Goff Date: Tue, 18 Aug 2026 12:09:02 -0400 Subject: [PATCH 1/5] CUMULUS-5046 Extract owner account from SQS Queue URL to allow for cross account SQS queues --- CHANGELOG.md | 3 +++ packages/aws-client/src/SQS.ts | 7 ++++++- packages/aws-client/tests/test-SQS.js | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de9b9c9558f8..2376954e621d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6047,6 +6047,9 @@ included in the future will have a corresponding CHANGELOG entry in future relea - **CUMULUS-1808** - Add additional error messaging in `deleteSnsTrigger` to give users more context about where to look to resolve ResourceNotFound error when disabling or deleting a rule. +- **CUMULUS-5046** + - Support cross account SQS queues by extracting the owner account ID from the URL and using that in validation of queues. + ### Fixed - **CUMULUS-2281** diff --git a/packages/aws-client/src/SQS.ts b/packages/aws-client/src/SQS.ts index 693ce01bcbc0..680d0ab90645 100644 --- a/packages/aws-client/src/SQS.ts +++ b/packages/aws-client/src/SQS.ts @@ -29,6 +29,7 @@ export interface SQSMessage extends Message { } export const getQueueNameFromUrl = (queueUrl: string) => queueUrl.split('/').pop(); +export const getQueueOwnerAccountFromUrl = (queueUrl: string) => queueUrl.split('/')[queueUrl.split('/').length - 2]; export const getQueueUrl = (sourceArn: string, queueName: string) => { const arnParts = sourceArn.split(':'); @@ -184,12 +185,16 @@ export const deleteSQSMessage = (QueueUrl: string, ReceiptHandle: string) => { */ export const sqsQueueExists = async (queueUrl: string) => { const QueueName = getQueueNameFromUrl(queueUrl); + const QueueAccount = getQueueOwnerAccountFromUrl(queueUrl); if (!QueueName) { throw new Error(`Unable to determine QueueName from ${queueUrl}`); } - const command = new GetQueueUrlCommand({ QueueName }); + const command = new GetQueueUrlCommand({ + QueueName: QueueName , + QueueOwnerAWSAccountId: QueueAccount + }); try { await sqs().send(command); diff --git a/packages/aws-client/tests/test-SQS.js b/packages/aws-client/tests/test-SQS.js index 8748b0a5f2f9..3c5b12bbccd9 100644 --- a/packages/aws-client/tests/test-SQS.js +++ b/packages/aws-client/tests/test-SQS.js @@ -8,6 +8,7 @@ const { sqs } = require('../services'); const { createQueue, getQueueNameFromUrl, + getQueueOwnerAccountFromUrl, parseSQSMessageBody, sqsQueueExists, sendSQSMessage, @@ -78,6 +79,14 @@ test('getQueueNameFromUrl extracts queue name from a queue URL', (t) => { t.is(extractedName, queueName); }); +test('getQueueNameFromUrl extracts queue owner account ID from a queue URL', (t) => { + const queueOwnerAccount = '123456789012'; + const queueName = 'MyQueue'; + const queueUrl = `https://sqs.us-east-2.amazonaws.com/${queueOwnerAccount}/${queueName}`; + const extractedOwnerAccount = getQueueOwnerAccountFromUrl(queueUrl); + t.is(extractedOwnerAccount, queueOwnerAccount); +}); + test('sendSQSMessage logs errors', async (t) => { const testConsole = new TestConsole(); const log = new Logger({ console: testConsole }); From 72f6097ac3605e7f743d93048c3a9f1fd280c4d9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2026 16:17:45 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- packages/aws-client/src/SQS.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-client/src/SQS.ts b/packages/aws-client/src/SQS.ts index 680d0ab90645..2a249b63cb1b 100644 --- a/packages/aws-client/src/SQS.ts +++ b/packages/aws-client/src/SQS.ts @@ -191,8 +191,8 @@ export const sqsQueueExists = async (queueUrl: string) => { throw new Error(`Unable to determine QueueName from ${queueUrl}`); } - const command = new GetQueueUrlCommand({ - QueueName: QueueName , + const command = new GetQueueUrlCommand({ + QueueName: QueueName , QueueOwnerAWSAccountId: QueueAccount }); From 0912da9685ac0e96d2c3a44786c0cc59fb887141 Mon Sep 17 00:00:00 2001 From: Timothy Goff Date: Wed, 19 Aug 2026 10:06:20 -0400 Subject: [PATCH 3/5] CUMULUS-5309 CUMULUS-5046 fix linter errors --- packages/aws-client/src/SQS.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/aws-client/src/SQS.ts b/packages/aws-client/src/SQS.ts index 2a249b63cb1b..50c043de7207 100644 --- a/packages/aws-client/src/SQS.ts +++ b/packages/aws-client/src/SQS.ts @@ -191,9 +191,9 @@ export const sqsQueueExists = async (queueUrl: string) => { throw new Error(`Unable to determine QueueName from ${queueUrl}`); } - const command = new GetQueueUrlCommand({ - QueueName: QueueName , - QueueOwnerAWSAccountId: QueueAccount + const command = new GetQueueUrlCommand({ + QueueName: QueueName, + QueueOwnerAWSAccountId: QueueAccount, }); try { From 2ebf9fe2e72ca3206eeaa04715159d45c12ddac1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 14:08:41 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- packages/aws-client/src/SQS.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-client/src/SQS.ts b/packages/aws-client/src/SQS.ts index 50c043de7207..c9b8a4435cb5 100644 --- a/packages/aws-client/src/SQS.ts +++ b/packages/aws-client/src/SQS.ts @@ -191,8 +191,8 @@ export const sqsQueueExists = async (queueUrl: string) => { throw new Error(`Unable to determine QueueName from ${queueUrl}`); } - const command = new GetQueueUrlCommand({ - QueueName: QueueName, + const command = new GetQueueUrlCommand({ + QueueName: QueueName, QueueOwnerAWSAccountId: QueueAccount, }); From d566aaad92f27e6dc00deeb83a4326a54c5803bb Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 1 Sep 2026 15:09:56 -0400 Subject: [PATCH 5/5] adjust changelog to reference correct CUMULUS-XXXX ticket ID --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc1d6bf38a2b..887354eae955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added +- **CUMULUS-5309** + - Support cross account SQS queues by extracting the owner account ID from the URL and using that in validation of queues. + - **CUMULUS-5256** - Add orphan file cleanup to Iceberg tables @@ -6071,9 +6074,6 @@ included in the future will have a corresponding CHANGELOG entry in future relea - **CUMULUS-1808** - Add additional error messaging in `deleteSnsTrigger` to give users more context about where to look to resolve ResourceNotFound error when disabling or deleting a rule. -- **CUMULUS-5046** - - Support cross account SQS queues by extracting the owner account ID from the URL and using that in validation of queues. - ### Fixed - **CUMULUS-2281**