docs/current_docs/adopting/triggers/aws-codebuild.mdx
Dagger runs your checks in AWS CodeBuild via dagger check, so the same checks you run locally run on every build — without rewriting your pipeline. You keep your existing CodeBuild project and buildspec.yml, and simply invoke the Dagger CLI from it.
:::tip
For checks with no buildspec at all, enable Cloud Checks with dagger ws autocheck on. The buildspec below is the hybrid-mode alternative for when you want to drive Dagger from your existing AWS CodeBuild setup.
:::
When running a CI pipeline with Dagger using AWS CodeBuild, the general workflow looks like this:
buildspec.yml file.dagger check against the modules installed in your workspace.DAGGER_CLOUD_TOKEN environment variable is set..dagger/config.toml) — see Workspace Setup.The following example demonstrates how to run your Dagger checks in an AWS CodeBuild project. dagger check runs all checks from the modules installed in your workspace and exits non-zero if any check fails; scope it to a single module's checks with a pattern such as dagger check go:*.
By default the CLI starts a Dagger Engine inside the CodeBuild runner. For a faster, more reliable experience, offload execution to a managed Dagger Engine provided by Dagger Cloud by adding --cloud to the command (dagger check --cloud). Cloud Engines provide a large persistent cache shared across runs and far more compute than a CodeBuild runner, so checks are typically much faster — and you don't provision or maintain any infrastructure. This requires the DAGGER_CLOUD_TOKEN environment variable configured above.
If you have any questions about additional ways to use AWS CodeBuild with Dagger, join our Discord and ask your questions in our AWS channel.
AWS CodeBuild is a managed service to test, build and deploy applications in public or private repositories.