{"record":{"id":"11c65b05f3c45ff7","repo":"anomalyco/sst","slug":"cannot-access-nodes-cloudmapservice-for-the-s","errorCode":null,"errorMessage":"Cannot access \"nodes.cloudmapService\" for the \"${self._name}\" Service. Cloud Map is not configured for the cluster.","messagePattern":"Cannot access \"nodes\\.cloudmapService\" for the \"(.+?)\" Service\\. Cloud Map is not configured for the cluster\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/service.ts","lineNumber":2938,"sourceCode":"      get autoScalingTarget() {\n        if (self.dev)\n          throw new VisibleError(\n            \"Cannot access `nodes.autoScalingTarget` in dev mode.\",\n          );\n        return self.autoScalingTarget!;\n      },\n      /**\n       * The Amazon Cloud Map service.\n       */\n      get cloudmapService() {\n        if (self.dev)\n          throw new VisibleError(\n            \"Cannot access `nodes.cloudmapService` in dev mode.\",\n          );\n\n        return output(self.cloudmapService).apply((service) => {\n          if (!service)\n            throw new VisibleError(\n              `Cannot access \"nodes.cloudmapService\" for the \"${self._name}\" Service. Cloud Map is not configured for the cluster.`,\n            );\n          return service;\n        });\n      },\n    };\n  }\n\n  /** @internal */\n  public getSSTLink() {\n    return {\n      properties: {\n        url: this.dev ? this.devUrl : this._url,\n        service: output(this.cloudmapNamespace).apply((namespace) =>\n          namespace ? this.service : undefined,\n        ),\n      },\n    };","sourceCodeStart":2920,"sourceCodeEnd":2956,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/service.ts#L2920-L2956","documentation":"SST's Service component (ECS/Fargate) exposes `nodes.cloudmapService` only when the underlying AWS Cloud Map service was created for the cluster. When the Service runs with cloudMap not configured (or in a mode where no Cloud Map service exists), the getter returns undefined and SST throws this VisibleError instead of handing back an undefined Pulumi resource.","triggerScenarios":"Accessing `service.nodes.cloudmapService` on a Service component created without the `cloudMap` prop (or with a service/namespace setup that yields no Cloud Map service).","commonSituations":"Referencing nodes.cloudmapService in another component (e.g. to register a custom domain or link the service) while the Service was declared without cloudMap discovery settings; copying example code that assumed cloudMap was enabled by default.","solutions":["Add or fix the `cloudMap` prop on the Service component so a Cloud Map service is created","If you only need the URL/link, use `service.url` or getSSTLink properties instead of nodes.cloudmapService","Verify the cluster/namespace referenced by cloudMap exists so the service can be created"],"exampleFix":"// before\nnew sst.aws.Service(\"MyService\", { cluster });\nconst cm = svc.nodes.cloudmapService; // throws\n// after\nnew sst.aws.Service(\"MyService\", { cluster, cloudMap: true });\nconst cm = svc.nodes.cloudmapService;","handlingStrategy":"validation","validationCode":"if (!svcArgs.cloudMap) {\n  throw new Error(\"Set cloudMap: true on the Service before accessing nodes.cloudmapService\");\n}","typeGuard":"function hasCloudmapService(svc: sst.aws.Service & { nodes: { cloudmapService?: unknown } }): boolean {\n  return svc != null && svc.nodes?.cloudmapService != null;\n}","tryCatchPattern":"try {\n  const cm = svc.nodes.cloudmapService;\n} catch (e) {\n  // fall back to svc.url or configure cloudMap\n}","preventionTips":["Always pass cloudMap: true when you plan to reference nodes.cloudmapService","Prefer the Service's url/link properties over raw nodes unless you need the resource","Never access nodes.* getters in `sst dev` for Service components (dev mode throws its own error)"],"tags":["aws","cloudmap","ecs","config"],"backgroundTag":"resource-not-configured","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}