{"record":{"id":"ad281f1c4c96c235","repo":"anomalyco/sst","slug":"the-provided-arn-arn-is-not-a-opensearch-doma","errorCode":null,"errorMessage":"The provided ARN \"${arn}\" is not a OpenSearch domain ARN.","messagePattern":"The provided ARN \"(.+?)\" is not a OpenSearch domain ARN\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/helpers/arn.ts","lineNumber":149,"sourceCode":"\n  return { functionName, region, version };\n}\n\nexport function parseElasticSearch(arn: string) {\n  // arn:aws:es: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 ElasticSearch domain ARN.`,\n    );\n  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,","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/helpers/arn.ts#L131-L167","documentation":"parseOpenSearch extracts the domain name from an OpenSearch domain ARN (arn:aws:opensearch:region:account:domain/name). It throws a VisibleError when the input does not start with \"arn:\" or lacks a segment after the first \"/\".","triggerScenarios":"Supplying a malformed string, a non-ARN endpoint URL, or an ARN without the domain/<name> suffix where an OpenSearch domain ARN is required.","commonSituations":"Using the OpenSearch collection ARN (serverless) instead of a domain ARN; pasting the dashboard endpoint URL; truncating the ARN when copying from the console.","solutions":["Use the full OpenSearch domain ARN of the form arn:aws:opensearch:<region>:<account>:domain/<name>","Confirm the resource is an OpenSearch domain, not a serverless collection","Reference the SST resource's .arn output programmatically"],"exampleFix":"// before\nconst os = \"arn:aws:opensearch:us-east-1:123456789012:domain\"\n// after\nconst os = \"arn:aws:opensearch:us-east-1:123456789012:domain/movies\"","handlingStrategy":"validation","validationCode":"function isOpenSearchDomainArn(arn: string) {\n  return arn.startsWith(\"arn:\") && !!arn.split(\"/\")[1];\n}","typeGuard":"const isOpenSearchDomainArn = (arn: string): boolean => /^arn:aws:opensearch:[^:]+:[^:]+:domain\\/.+/.test(arn);","tryCatchPattern":"try { const { tableName } = parseOpenSearch(arn); } catch (e) { /* surface invalid ARN to user */ }","preventionTips":["Distinguish domain vs collection ARNs","Use resource .arn outputs","Validate ARN shape before passing"],"tags":["arn","opensearch","validation"],"backgroundTag":"invalid-arn-format","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}