Skip to content
Latchkey

Fix: CodeBuild Runner Compute Type and Image Errors

The image and instance-size overrides only work with the exact identifiers CodeBuild publishes. Here is the current list and the syntax.

According to AWS CodeBuild docs, you can override the environment image, instance size, or fleet from the runs-on label, but only with the identifiers CodeBuild supports. A wrong identifier is a common cause of a build that will not start or runs on the wrong environment. This page lists the documented options; verify the current list against the AWS source, as AWS adds and retires images.

The override syntax

According to AWS docs, append overrides to the label, for example: image:<environment-type>-<image-identifier> and instance-size:<size>. For an EC2 build the environment type and image identifier come from the supported-images list; for example image:arm-3.0 with instance-size:small.

Supported EC2 environment types

According to AWS docs, EC2 environment types include linux (image identifiers 4.0 and 5.0), linux-ec2 (latest), arm (2.0 and 3.0), arm-ec2 (latest), ubuntu (5.0, 6.0, 7.0), windows (1.0, 2.0, 3.0), and windows-ec2 (2022). These cover Amazon Linux, Ubuntu, ARM/Graviton, and Windows Server Core platforms.

Instance sizes and GPU

According to AWS docs, instance sizes include small, medium, large, xlarge, and 2xlarge on many Linux images, plus gpu_small and gpu_large on GPU-capable Linux images such as linux 4.0 and ubuntu 5.0. Windows images document medium and large. Use gpu_small or gpu_large when your job needs GPU compute.

Lambda compute images

According to AWS docs, Lambda environment types linux-lambda and arm-lambda support runtime-specific image identifiers (for example nodejs20, python3.12, corretto21, go1.21) with memory sizes 1GB through 10GB. Lambda compute is billed per build-second rather than per build-minute.

Fleet overrides

According to AWS docs, to run on reserved capacity, append fleet:<fleet-name> to the label; you can combine it with an image override. If you provide no image override, CodeBuild uses the image configured on the project, which is how custom images are used.

Frequently asked questions

How do I run a CodeBuild GitHub Actions job on ARM or GPU?
According to AWS docs, add an override such as image:arm-3.0 for Graviton ARM, or an instance-size of gpu_small or gpu_large on a GPU-capable Linux image, to the runs-on label. Confirm the identifier against the AWS supported-images list.
Where can I verify these CodeBuild details?
These points come from AWS CodeBuild docs and the AWS CodeBuild pricing page (reviewed 2026-07-02). AWS pricing varies by Region and compute type and changes over time, so verify current rates and free-tier terms on the AWS pricing page before you budget. Primary sources: AWS CodeBuild docs, "Configure a CodeBuild-hosted GitHub Actions runner": https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html | AWS CodeBuild docs, "Troubleshoot the webhook": https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner-troubleshoot-webhook.html | AWS CodeBuild docs, "Compute images supported with the CodeBuild-hosted GitHub Actions runner": https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-action-runners-update-yaml.images.html | AWS CodeBuild pricing: https://aws.amazon.com/codebuild/pricing/ | AWS CodeBuild docs, "Quotas for AWS CodeBuild": https://docs.aws.amazon.com/codebuild/latest/userguide/limits.html

Related guides

See what you would save - Latchkey managed runners with self-healing. Start free →