{"record":{"id":"8c7e423fc671e66e","repo":"anomalyco/sst","slug":"the-provided-arn-arn-is-not-a-elasticsearch-d","errorCode":null,"errorMessage":"The provided ARN \"${arn}\" is not a ElasticSearch domain ARN.","messagePattern":"The provided ARN \"(.+?)\" is not a ElasticSearch domain ARN\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/helpers/arn.ts","lineNumber":139,"sourceCode":"    throw new VisibleError(\n      `Lambda@Edge functions must be deployed in us-east-1 region. Got region: ${region}`,\n    );\n  }\n\n  if (!version || version === \"$LATEST\") {\n    throw new VisibleError(\n      `Lambda@Edge requires a qualified ARN (with version). Got: ${arn}`,\n    );\n  }\n\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];","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/helpers/arn.ts#L121-L157","documentation":"parseElasticSearch extracts the domain name from an Elasticsearch domain ARN (arn:aws:es:region:account:domain/name). It throws a VisibleError when the string does not start with \"arn:\" or has no segment after the first \"/\", meaning it is not a valid ES domain ARN.","triggerScenarios":"Passing a non-ARN string, a malformed ARN, or an ARN of a different resource type (e.g. missing the domain/ suffix) where an Elasticsearch domain ARN is expected.","commonSituations":"Pasting a domain endpoint URL (https://search-xxx.es.amazonaws.com) instead of the ARN; typos truncating the /domain-name part; using a plain Lambda ARN by mistake.","solutions":["Copy the full domain ARN from the AWS Elasticsearch console (starts with arn:aws:es:...:domain/name)","Verify the ARN contains a \"/\" followed by the domain name","Use the SST resource's .arn output instead of a hand-typed value"],"exampleFix":"// before\nconst es = \"https://search-mydomain-abc.us-east-1.es.amazonaws.com\"\n// after\nconst es = \"arn:aws:es:us-east-1:123456789012:domain/mydomain\"","handlingStrategy":"validation","validationCode":"function isEsDomainArn(arn: string) {\n  return arn.startsWith(\"arn:\") && !!arn.split(\"/\")[1];\n}","typeGuard":"const isEsDomainArn = (arn: string): boolean => /^arn:aws:es:[^:]+:[^:]+:domain\\/.+/.test(arn);","tryCatchPattern":"try { const { tableName } = parseElasticSearch(arn); } catch (e) { /* fall back to prompting for a valid ARN */ }","preventionTips":["Copy ARNs from console, not endpoint URLs","Use SST resource .arn outputs","Regex-validate ARNs in config"],"tags":["arn","elasticsearch","validation"],"backgroundTag":"invalid-arn-format","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}