{"record":{"id":"cb4b09029b486db6","repo":"anomalyco/sst","slug":"the-provided-arn-arn-is-not-a-dsql-cluster-ar","errorCode":null,"errorMessage":"The provided ARN \"${arn}\" is not a DSQL cluster ARN.","messagePattern":"The provided ARN \"(.+?)\" is not a DSQL cluster ARN\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/helpers/arn.ts","lineNumber":160,"sourceCode":"  return { tableName };\n}\n\nexport function parseOpenSearch(arn: string) {\n  // arn:aws:opensearch:region:account-id:domain/domain-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 OpenSearch domain ARN.`,\n    );\n  return { tableName };\n}\n\nexport function parseDsqlPublicEndpoint(arn: string) {\n  const parts = arn.split(\":\");\n  const region = parts[3];\n  const clusterId = parts[5]?.split(\"/\")[1];\n  if (!arn.startsWith(\"arn:\") || !clusterId)\n    throw new VisibleError(\n      `The provided ARN \"${arn}\" is not a DSQL cluster ARN.`,\n    );\n  return `${clusterId}.dsql.${region}.on.aws`;\n}\n\nexport function parseDsqlPrivateEndpoint(\n  clusterArn: string,\n  dnsEntries: { dnsName?: string }[],\n) {\n  const clusterId = clusterArn.split(\":\")[5]?.split(\"/\")[1];\n  if (!clusterArn.startsWith(\"arn:\") || !clusterId)\n    throw new VisibleError(\n      `The provided ARN \"${clusterArn}\" is not a DSQL cluster ARN.`,\n    );\n  const wildcardEntry = dnsEntries.find((e) => e.dnsName?.startsWith(\"*.\"));\n  const privateDnsName = wildcardEntry?.dnsName ?? dnsEntries[0]?.dnsName;\n  if (!privateDnsName)\n    throw new VisibleError(","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/helpers/arn.ts#L142-L178","documentation":"parseDsqlPublicEndpoint builds the public DSQL endpoint hostname from a cluster ARN by extracting the cluster id (field after domain/ in the 6th colon segment). It throws a VisibleError if the string is not an arn: or the cluster id cannot be found.","triggerScenarios":"Passing a non-ARN value, a wrong-region-format ARN, or an ARN without cluster/<id> in the resource segment to a DSQL link/endpoint configuration.","commonSituations":"Pasting the DSQL connection hostname instead of the ARN; copying a partial ARN; using another resource type's ARN by mistake.","solutions":["Copy the full cluster ARN (arn:aws:dsql:<region>:<account>:cluster/<id>) from the AWS DSQL console","Ensure the ARN contains cluster/ followed by the cluster id","Use the sst.aws.Dsql resource's arn output instead of manual strings"],"exampleFix":"// before\nconst arn = \"abc123.dsql.us-east-1.on.aws\"\n// after\nconst arn = \"arn:aws:dsql:us-east-1:123456789012:cluster/abc123\"","handlingStrategy":"validation","validationCode":"function isDsqlClusterArn(arn: string) {\n  return arn.startsWith(\"arn:\") && !!arn.split(\":\")[5]?.split(\"/\")[1];\n}","typeGuard":"const isDsqlClusterArn = (arn: string): boolean => /^arn:aws:dsql:[^:]+:[^:]+:cluster\\/.+/.test(arn);","tryCatchPattern":"try { const host = parseDsqlPublicEndpoint(arn); } catch (e) { /* request correct cluster ARN */ }","preventionTips":["Pass cluster.arn from the Dsql component","Never paste hostnames where ARNs are expected","Unit-test ARN parsing with real shapes"],"tags":["arn","dsql","validation"],"backgroundTag":"invalid-arn-format","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}