Skip to content

Instantly share code, notes, and snippets.

@userbradley
Last active September 14, 2025 17:19
Show Gist options
  • Select an option

  • Save userbradley/794a9ffa4af40f9705b4fce03a6daa2d to your computer and use it in GitHub Desktop.

Select an option

Save userbradley/794a9ffa4af40f9705b4fce03a6daa2d to your computer and use it in GitHub Desktop.
atlantis.yaml schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/schemas/atlantis-config.schema.json",
"title": "Atlantis server-side repo config",
"type": "object",
"additionalProperties": false,
"properties": {
"version": {
"description": "Config version (example: 3)",
"type": "integer",
"minimum": 1
},
"automerge": {
"type": "boolean",
"description": "Enable automerge"
},
"autodiscover": {
"type": "object",
"description": "Autodiscover configuration",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string"
},
"ignore_paths": {
"type": "array",
"items": { "type": "string" }
}
}
},
"delete_source_branch_on_merge": {
"type": "boolean"
},
"parallel_plan": { "type": "boolean" },
"parallel_apply": { "type": "boolean" },
"abort_on_execution_order_fail": { "type": "boolean" },
"projects": {
"type": "array",
"items": { "$ref": "#/definitions/project" }
},
"workflows": {
"type": "object",
"description": "Named workflows",
"additionalProperties": { "$ref": "#/definitions/workflow" },
"propertyNames": {
"type": "string",
"minLength": 1
}
},
"allowed_regexp_prefixes": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["projects"],
"definitions": {
"project": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Project name. If set, cannot be empty."
},
"branch": {
"type": "string",
"description": "Branch regex (must begin and end with /). Example: /main/"
},
"dir": {
"type": "string",
"description": "Relative path to project (required).",
"minLength": 1,
"pattern": "^(?!.*\\.\\.).*$"
},
"workspace": {
"type": "string",
"description": "Terraform workspace. Default is 'default' if omitted."
},
"workflow": {
"type": "string",
"description": "Name of workflow to use for this project."
},
"terraform_distribution": {
"type": "string",
"enum": ["terraform", "opentofu"],
"description": "Distribution for terraform tooling."
},
"terraform_version": {
"type": "string",
"description": "Terraform version string. Program will validate semantic version if provided.",
"pattern": "^v?\\d+(\\.\\d+){0,2}(-[0-9A-Za-z.-]+)?$"
},
"autoplan": { "$ref": "#/definitions/autoplan" },
"plan_requirements": {
"type": "array",
"items": {
"type": "string",
"enum": ["approved", "mergeable", "undiverged"]
}
},
"apply_requirements": {
"type": "array",
"items": {
"type": "string",
"enum": ["approved", "mergeable", "undiverged"]
}
},
"import_requirements": {
"type": "array",
"items": {
"type": "string",
"enum": ["approved", "mergeable", "undiverged"]
}
},
"depends_on": {
"type": "array",
"items": { "type": "string" }
},
"delete_source_branch_on_merge": { "type": "boolean" },
"repo_locking": {
"type": "boolean",
"deprecated": true,
"description": "Deprecated: prefer using repo_locks"
},
"repo_locks": { "$ref": "#/definitions/repo_locks" },
"custom_policy_check": { "type": "boolean" },
"policy_check": { "type": "boolean" },
"autoplan": { "$ref": "#/definitions/autoplan" },
"silence_pr_comments": {
"type": "array",
"items": { "type": "string" }
},
"execution_order_group": {
"type": "integer"
}
},
"required": ["dir"]
},
"autoplan": {
"type": "object",
"additionalProperties": false,
"properties": {
"when_modified": {
"type": "array",
"items": { "type": "string" }
},
"enabled": { "type": "boolean" },
"apply_requirements": {
"type": "array",
"items": { "type": "string" }
}
}
},
"repo_locks": {
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string",
"description": "Mode for repo locks (example: on_plan)",
"minLength": 1
},
"exempt_users": {
"type": "array",
"items": { "type": "string" }
}
}
},
"workflow": {
"type": "object",
"additionalProperties": false,
"properties": {
"plan": { "$ref": "#/definitions/workflow_action" },
"apply": { "$ref": "#/definitions/workflow_action" },
"policy_check": { "$ref": "#/definitions/workflow_action" },
"import": { "$ref": "#/definitions/workflow_action" }
}
},
"workflow_action": {
"type": "object",
"additionalProperties": false,
"properties": {
"steps": {
"type": "array",
"items": { "$ref": "#/definitions/workflow_step" }
}
},
"required": ["steps"]
},
"workflow_step": {
"oneOf": [
{
"type": "string",
"description": "Simple step keyword such as 'init', 'plan', 'apply'"
},
{
"type": "object",
"properties": {
"run": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"additionalProperties": false,
"properties": {
"command": { "type": "string" },
"output": { "type": "string", "enum": ["hide", "show"] }
},
"required": ["command"]
}
]
}
},
"required": ["run"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"init": { "type": "object", "additionalProperties": true }
},
"required": ["init"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"plan": {
"type": "object",
"additionalProperties": false,
"properties": {
"extra_args": {
"type": "array",
"items": { "type": "string" }
},
"flags": {
"type": "array",
"items": { "type": "string" }
}
}
}
},
"required": ["plan"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"apply": { "type": "object", "additionalProperties": true }
},
"required": ["apply"],
"additionalProperties": false
}
]
}
}
}
@userbradley
Copy link
Author

LLM prompt

Using the below yaml file from `https://www.runatlantis.io/docs/repo-level-atlantis-yaml` generate a `schema.json` file that I can use in my IDE to provide syntax correction and auto-complete

<paste the yaml file from https://www.runatlantis.io/docs/repo-level-atlantis-yaml here>

@userbradley
Copy link
Author

You can use this in pre-commit like

repos:
  - repo: https://github.com/python-jsonschema/check-jsonschema
    rev: 0.33.3
    hooks:
      - id: check-jsonschema
        name: Ensure atlantis file follow Schema
        files: atlantis.yaml
        args: ["--schemafile", "https://gist.githubusercontent.com/userbradley/794a9ffa4af40f9705b4fce03a6daa2d/raw/2232dc24603d22344940d705a14f1814230feef9/schema.json"]

@userbradley
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment