{"record":{"id":"b5503ef580e50365","repo":"anomalyco/sst","slug":"the-provided-arn-arn-is-not-an-sqs-queue-arn","errorCode":null,"errorMessage":"The provided ARN \"${arn}\" is not an SQS Queue ARN.","messagePattern":"The provided ARN \"(.+?)\" is not an SQS Queue ARN\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/helpers/arn.ts","lineNumber":52,"sourceCode":"    );\n  return { bucketName };\n}\n\nexport function parseTopicArn(arn: string) {\n  // arn:aws:sns:region:account-id:topic-name\n  const topicName = arn.split(\":\")[5];\n  if (!arn.startsWith(\"arn:\") || !topicName)\n    throw new VisibleError(\n      `The provided ARN \"${arn}\" is not an SNS Topic ARN.`,\n    );\n  return { topicName };\n}\n\nexport function parseQueueArn(arn: string) {\n  // arn:aws:sqs:region:account-id:queue-name\n  const [arnStr, , , region, accountId, queueName] = arn.split(\":\");\n  if (arnStr !== \"arn\" || !queueName)\n    throw new VisibleError(\n      `The provided ARN \"${arn}\" is not an SQS Queue ARN.`,\n    );\n  return {\n    queueName,\n    queueUrl: `https://sqs.${region}.amazonaws.com/${accountId}/${queueName}`,\n  };\n}\n\nexport function parseDynamoArn(arn: string) {\n  // arn:aws:dynamodb:region:account-id:table/table-name\n  const tableName = arn.split(\"/\")[1];\n  if (!arn.startsWith(\"arn:\") || !tableName)\n    throw new VisibleError(\n      `The provided ARN \"${arn}\" is not a DynamoDB table ARN.`,\n    );\n  return { tableName };\n}\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/helpers/arn.ts#L34-L70","documentation":"parseQueueArn validates an SQS queue ARN (arn:aws:sqs:region:account-id:queue-name) and derives the queue URL. It throws a VisibleError when the first segment is not 'arn' or the queue-name segment is missing.","triggerScenarios":"Subscribing a function to an SQS queue by ARN or creating a queue policy where the string is a queue URL, a queue name, or a malformed ARN.","commonSituations":"Passing the queue URL (https://sqs...) instead of the ARN, passing just the queue name, or a FIFO queue name copied without proper segments.","solutions":["Use the full form arn:aws:sqs:region:account-id:queue-name","Do not pass the queue URL; parseQueueArn generates the URL from the ARN itself","Copy the ARN directly from the SQS console queue details"],"exampleFix":"// before\nparseQueueArn(\"https://sqs.us-east-1.amazonaws.com/123456789012/my-queue\");\n// after\nparseQueueArn(\"arn:aws:sqs:us-east-1:123456789012:my-queue\");","handlingStrategy":"validation","validationCode":"const QUEUE_ARN = /^arn:aws[a-zA-Z-]*:sqs:[^:]+:\\d{12}:.+$/;\nif (!QUEUE_ARN.test(arn)) throw new Error(`Not an SQS queue ARN: ${arn}`);","typeGuard":"function isQueueArn(v: string): boolean {\n  return /^arn:aws[a-zA-Z-]*:sqs:[^:]+:\\d{12}:.+$/.test(v);\n}","tryCatchPattern":"try {\n  const { queueName, queueUrl } = parseQueueArn(arn);\n} catch (e) {\n  throw new Error(`Failed to parse SQS queue ARN \"${arn}\": ${(e as Error).message}`);\n}","preventionTips":["Never pass the queue URL where an ARN is expected; they are different formats","Use sst.aws.Queue.arn from the component instead of console-copied strings","Watch for FIFO suffix (.fifo) surviving truncation"],"tags":["arn","sqs","validation","sst"],"backgroundTag":"invalid-arn-format","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}