Overview

Exit Codes

CloudBurn CLI exit codes and how to use them in CI/CD pipelines.


CloudBurn uses consistent exit codes so you can integrate its output into CI/CD pipelines, shell scripts, and quality gates.

Exit codes

CodeConstantMeaning
0EXIT_CODE_OKScan completed successfully with no findings, or --exit-code flag was not passed
1EXIT_CODE_POLICY_VIOLATIONFindings exist AND --exit-code was passed
2EXIT_CODE_RUNTIME_ERRORRuntime error — credentials missing, path not found, config invalid, etc.

When to use --exit-code

By default, CloudBurn exits 0 even when it finds issues. This lets you use CloudBurn for informational scans without breaking your build.

Pass --exit-code when you want CloudBurn to act as a quality gate — for example, to block a pull request if cost issues are found:

cloudburn scan --exit-code
cloudburn discover --exit-code

CI example

- name: Run CloudBurn scan
  run: cloudburn scan --exit-code

This step fails the CI job if any findings are returned. To allow the pipeline to continue and just report findings, omit --exit-code.

Error output format

When CloudBurn encounters a runtime error (exit code 2), it writes a JSON error object to stderr:

{
  "error": "RUNTIME_ERROR",
  "message": "Config file not found: /path/to/.cloudburn.yml"
}

Redirect stderr separately if you need to handle errors differently from findings:

cloudburn --format json scan --exit-code ./iac 2>error.json

What's next

CI/CD IntegrationFull GitHub Actions and GitLab CI pipeline examples
Output FormatsUse JSON output for structured error handling
cloudburn scanAll scan flags including --exit-code