anomalyco/sst · error · VisibleError
You must provide both "vpc.cloudmapNamespaceId" and "vpc.clo
Error message
You must provide both "vpc.cloudmapNamespaceId" and "vpc.cloudmapNamespaceName" for the "${name}" Cluster component. What it means
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.
Source
Thrown at platform/src/components/aws/cluster.ts:293
return args.vpc;
}
// "vpc" is object
return output(args.vpc).apply((vpc) => {
if (vpc.containerSubnets && vpc.serviceSubnets)
throw new VisibleError(
`You cannot provide both "vpc.containerSubnets" and "vpc.serviceSubnets" in the "${name}" Cluster component. The "serviceSubnets" property has been deprecated. Use "containerSubnets" instead.`,
);
if (!vpc.containerSubnets && !vpc.serviceSubnets)
throw new VisibleError(
`Missing "vpc.containerSubnets" for the "${name}" Cluster component.`,
);
if (
(vpc.cloudmapNamespaceId && !vpc.cloudmapNamespaceName) ||
(!vpc.cloudmapNamespaceId && vpc.cloudmapNamespaceName)
)
throw new VisibleError(
`You must provide both "vpc.cloudmapNamespaceId" and "vpc.cloudmapNamespaceName" for the "${name}" Cluster component.`,
);
return {
...vpc,
containerSubnets: (vpc.containerSubnets ?? vpc.serviceSubnets)!,
serviceSubnets: undefined,
};
});
}
function createCluster() {
return new ecs.Cluster(
...transform(
args.transform?.cluster,
`${name}Cluster`,
{
tags: {View on GitHub (pinned to a0bd20f762)
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.
Example fix
// before
vpc: { containerSubnets: [...], cloudmapNamespaceId: 'ns-abc' }
// after
vpc: { containerSubnets: [...], cloudmapNamespaceId: 'ns-abc', cloudmapNamespaceName: 'myapp.local' } Defensive patterns
Strategy: validation
Validate before calling
function requireCloudmapPair(vpc) {
const hasId = !!vpc?.cloudmapNamespaceId, hasName = !!vpc?.cloudmapNamespaceName;
if (hasId !== hasName)
throw new Error('Provide both cloudmapNamespaceId and cloudmapNamespaceName');
}
requireCloudmapPair(vpcConfig); Prevention
- 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.
When it happens
Trigger: Cluster vpc object with cloudmapNamespaceId set but cloudmapNamespaceName missing, or vice versa — checked in normalizeVpc.
Common situations: 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.
Related errors
- Cannot access the AWS Cloud Map service name for the "${this
- You cannot provide both "vpc.containerSubnets" and "vpc.serv
- Cannot access "nodes.cloudmapService" for the "${self._name}
- Need to provide a validated certificate via "cert" when DNS
- There have been some minor changes to the "Cluster" componen
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/56ecca5f84221472.
Report an issue: GitHub.