{"record":{"id":"56ecca5f84221472","repo":"anomalyco/sst","slug":"you-must-provide-both-vpc-cloudmapnamespaceid-an","errorCode":null,"errorMessage":"You must provide both \"vpc.cloudmapNamespaceId\" and \"vpc.cloudmapNamespaceName\" for the \"${name}\" Cluster component.","messagePattern":"You must provide both \"vpc\\.cloudmapNamespaceId\" and \"vpc\\.cloudmapNamespaceName\" for the \"(.+?)\" Cluster component\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/cluster.ts","lineNumber":293,"sourceCode":"        return args.vpc;\n      }\n\n      // \"vpc\" is object\n      return output(args.vpc).apply((vpc) => {\n        if (vpc.containerSubnets && vpc.serviceSubnets)\n          throw new VisibleError(\n            `You cannot provide both \"vpc.containerSubnets\" and \"vpc.serviceSubnets\" in the \"${name}\" Cluster component. The \"serviceSubnets\" property has been deprecated. Use \"containerSubnets\" instead.`,\n          );\n        if (!vpc.containerSubnets && !vpc.serviceSubnets)\n          throw new VisibleError(\n            `Missing \"vpc.containerSubnets\" for the \"${name}\" Cluster component.`,\n          );\n\n        if (\n          (vpc.cloudmapNamespaceId && !vpc.cloudmapNamespaceName) ||\n          (!vpc.cloudmapNamespaceId && vpc.cloudmapNamespaceName)\n        )\n          throw new VisibleError(\n            `You must provide both \"vpc.cloudmapNamespaceId\" and \"vpc.cloudmapNamespaceName\" for the \"${name}\" Cluster component.`,\n          );\n\n        return {\n          ...vpc,\n          containerSubnets: (vpc.containerSubnets ?? vpc.serviceSubnets)!,\n          serviceSubnets: undefined,\n        };\n      });\n    }\n\n    function createCluster() {\n      return new ecs.Cluster(\n        ...transform(\n          args.transform?.cluster,\n          `${name}Cluster`,\n          {\n            tags: {","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/cluster.ts#L275-L311","documentation":"Cloudmap namespace registration needs both the namespace ID and its name: the ID locates the namespace, the name is used for DNS record prefixes. Supplying exactly one is treated as a partial/invalid config, so SST throws.","triggerScenarios":"Cluster vpc object with cloudmapNamespaceId set but cloudmapNamespaceName missing, or vice versa — checked in normalizeVpc.","commonSituations":"Reading only the ID from the AWS console and hardcoding it while omitting the name; referencing a Vpc component's outputs but only wiring one of the two values.","solutions":["Provide both cloudmapNamespaceId and cloudmapNamespaceName in the vpc object.","If the cluster was created via sst.aws.Vpc, prefer passing the Vpc instance so both values are wired automatically.","Verify the namespace exists in AWS Cloud Map in the same region as the cluster."],"exampleFix":"// before\nvpc: { containerSubnets: [...], cloudmapNamespaceId: 'ns-abc' }\n// after\nvpc: { containerSubnets: [...], cloudmapNamespaceId: 'ns-abc', cloudmapNamespaceName: 'myapp.local' }","handlingStrategy":"validation","validationCode":"function requireCloudmapPair(vpc) {\n  const hasId = !!vpc?.cloudmapNamespaceId, hasName = !!vpc?.cloudmapNamespaceName;\n  if (hasId !== hasName)\n    throw new Error('Provide both cloudmapNamespaceId and cloudmapNamespaceName');\n}\nrequireCloudmapPair(vpcConfig);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass a sst.aws.Vpc instance so namespace id/name are wired together.","Copy both values together when hardcoding.","Verify the Cloud Map namespace in the AWS console before referencing it."],"tags":["aws","ecs","cloudmap","service-discovery","config-validation"],"backgroundTag":"missing-required-config-property","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}