anomalyco/sst · error · Error
Unsupported CPU: ${v}. The supported values for CPU are ${Ob
Error message
Unsupported CPU: ${v}. The supported values for CPU are ${Object.keys(supportedCpus).join(", ")} What it means
`Service`'s `cpu` arg is validated against the `supportedCpus` map (Fargate-valid CPU sizes shared with cluster-v1). If the provided string isn't a key of that map, normalizeCpu throws. The message lists every accepted value.
Source
Thrown at platform/src/components/aws/service-v1.ts:188
}
function normalizeImage() {
return all([args.image ?? {}, architecture]).apply(
([image, architecture]) => ({
...image,
context: image.context ?? ".",
platform:
architecture === "arm64"
? Platform.Linux_arm64
: Platform.Linux_amd64,
}),
);
}
function normalizeCpu() {
return output(args.cpu ?? "0.25 vCPU").apply((v) => {
if (!supportedCpus[v]) {
throw new Error(
`Unsupported CPU: ${v}. The supported values for CPU are ${Object.keys(
supportedCpus,
).join(", ")}`,
);
}
return v;
});
}
function normalizeMemory() {
return all([cpu, args.memory ?? "0.5 GB"]).apply(([cpu, v]) => {
if (!(v in supportedMemories[cpu])) {
throw new Error(
`Unsupported memory: ${v}. The supported values for memory for a ${cpu} CPU are ${Object.keys(
supportedMemories[cpu],
).join(", ")}`,
);
}View on GitHub (pinned to a0bd20f762)
Solutions
- Change `cpu` to one of the exact strings listed in the error (e.g. "0.25 vCPU", "0.5 vCPU", "1 vCPU", "2 vCPU", "4 vCPU", ...)
- Match the casing/format shown in supportedCpus — include the space and "vCPU" unit
- Remove the `cpu` arg to use the default "0.25 vCPU"
Example fix
// before
new sst.aws.Service("Api", { cpu: "512" });
// after
new sst.aws.Service("Api", { cpu: "0.5 vCPU" }); Defensive patterns
Strategy: validation
Validate before calling
const supportedCpus = ["0.25 vCPU","0.5 vCPU","1 vCPU","2 vCPU","4 vCPU","8 vCPU","16 vCPU"];
if (args.cpu && !supportedCpus.includes(args.cpu)) {
throw new Error(`Unsupported CPU: ${args.cpu}`);
} Type guard
function isSupportedCpu(v: string): boolean {
return ["0.25 vCPU","0.5 vCPU","1 vCPU","2 vCPU","4 vCPU","8 vCPU","16 vCPU"].includes(v);
} Prevention
- Use the exact "N vCPU" string format from the error message
- Centralize Fargate size constants in a shared module
- Avoid copying numeric ECS task-definition CPU units
When it happens
Trigger: Setting `cpu` to a string not exactly matching a supported value, e.g. `"1 vCPU"` vs `"0.5 vCPU"`, `"512"`, typo like `"0.25 vcpu"`, or an ECS-valid but Fargate-invalid combo.
Common situations: Copying ECS task-definition numbers (256/512) instead of the "0.25 vCPU" string format; guessing formats; outdated docs.
Related errors
- Unsupported memory: ${v}. The supported values for memory fo
- Unsupported storage: ${v}. The supported value for storage i
- You cannot provide both a function and a task in the "${name
- You cannot provide both a function and a task in the "${name
- Unsupported storage: ${v}. The supported value for storage i
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/dfa761af4fc9b134.
Report an issue: GitHub.