Skip to content

fix(schema): allow http as a valid terraform backend_type - #2920

Open
Rémy Macherel (MacherelR) wants to merge 2 commits into
cloudposse:mainfrom
MacherelR:fix/http-backend-type-schema
Open

fix(schema): allow http as a valid terraform backend_type#2920
Rémy Macherel (MacherelR) wants to merge 2 commits into
cloudposse:mainfrom
MacherelR:fix/http-backend-type-schema

Conversation

@MacherelR

@MacherelR Rémy Macherel (MacherelR) commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The atmos-manifest JSON Schema's backend_type/remote_state_backend_type enum and backend_manifest properties hardcoded 8 backend types (local, s3, remote, vault, static, azurerm, gcs, cloud) and rejected Terraform/ OpenTofu's generic http backend, used e.g. for GitLab-managed Terraform state. Since schema validation of imported/mixin files was recently fixed to actually run, any manifest using backend_type: http now fails atmos describe stacks (and anything that calls it, e.g. terraform plan/apply) outright, even though backend generation itself (generateComponentBackendConfig) has always handled arbitrary backend types generically.

Add "http" to both enums and to backend_manifest.properties, mirroring the existing entries. Also update the test fixture copy of the schema to keep it in sync, document the HTTP backend in the backend-config docs partial, and add a regression test proving backend_type: http now passes validation with the default embedded schema.

closes #2919

Summary by CodeRabbit

  • New Features

    • Added support for configuring HTTP backends for Terraform and remote state.
    • HTTP backend settings can be provided inline or through included configuration files.
    • Added support for state, locking, and unlock endpoints, request methods, and GitLab token credentials.
  • Documentation

    • Added YAML and JSON configuration examples for HTTP backends.
    • Warned that generated backend files may contain plaintext credentials and should not be committed, logged, or uploaded.

The atmos-manifest JSON Schema's backend_type/remote_state_backend_type
enum and backend_manifest properties hardcoded 8 backend types (local,
s3, remote, vault, static, azurerm, gcs, cloud) and rejected Terraform/
OpenTofu's generic `http` backend, used e.g. for GitLab-managed
Terraform state. Since schema validation of imported/mixin files was
recently fixed to actually run, any manifest using `backend_type: http`
now fails `atmos describe stacks` (and anything that calls it, e.g.
`terraform plan/apply`) outright, even though backend generation itself
(generateComponentBackendConfig) has always handled arbitrary backend
types generically.

Add "http" to both enums and to backend_manifest.properties, mirroring
the existing entries. Also update the test fixture copy of the schema
to keep it in sync, document the HTTP backend in the backend-config
docs partial, and add a regression test proving backend_type: http now
passes validation with the default embedded schema.

closes cloudposse#2919
@MacherelR
Rémy Macherel (MacherelR) requested a review from a team as a code owner August 11, 2026 12:50
@atmos-pro

atmos-pro Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@github-actions github-actions Bot added the size/m Medium size PR label Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 54e5352e-deba-4afe-b548-f1306c83f50b

📥 Commits

Reviewing files that changed from the base of the PR and between 3ba876f and d477195.

📒 Files selected for processing (2)
  • internal/exec/validate_stacks_test.go
  • website/docs/stacks/_partials/_backend-config.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/docs/stacks/_partials/_backend-config.mdx

📝 Walkthrough

Walkthrough

The manifest schemas now accept HTTP Terraform and remote-state backends. Validation tests cover HTTP backend configurations. Documentation describes endpoints, locking, authentication, and generated JSON.

Changes

HTTP backend support

Layer / File(s) Summary
Backend schema contract
pkg/datafetcher/schema/atmos/manifest/1.0.json, tests/fixtures/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
Both schemas allow http for Terraform and remote-state backend types. The backend manifest accepts an !include string or an object with arbitrary properties.
Validation and documentation
internal/exec/validate_stacks_test.go, website/docs/stacks/_partials/_backend-config.mdx
Tests validate standard and remote-state HTTP backend configurations. The documentation covers endpoints, locking, HTTP methods, authentication, and generated JSON.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: osterman

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: allowing http as a valid Terraform backend type.
Linked Issues check ✅ Passed The schema updates, fixture synchronization, documentation, and regression test address the requirements in [#2919].
Out of Scope Changes check ✅ Passed All changes support HTTP backend schema validation, documentation, or regression coverage described in [#2919].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/exec/validate_stacks_test.go`:
- Around line 251-260: The manifest test case around the existing HTTP backend
configuration only covers components. Add a table-driven scenario that
configures and validates remote-state HTTP settings using
remote_state_backend_type: http and remote_state_backend.http, including
representative address and lock/unlock fields, while preserving the existing
backend case and expected validation behavior.

In `@website/docs/stacks/_partials/_backend-config.mdx`:
- Around line 295-308: Update the Generated File example in the backend
configuration documentation to explicitly warn that backend.tf.json contains
credentials, including the expanded CI_JOB_TOKEN password, and must not be
committed, logged, or uploaded as an artifact.
- Around line 291-292: Update the backend configuration credentials to read
CI_JOB_TOKEN from the process environment using the supported env lookup syntax,
or first map it through the component env section with !env and reference that
mapping. Preserve the existing GitLab username and password configuration.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 071d042f-f31c-4f4f-95ec-b8daf2ed3537

📥 Commits

Reviewing files that changed from the base of the PR and between 21c5899 and 3ba876f.

📒 Files selected for processing (4)
  • internal/exec/validate_stacks_test.go
  • pkg/datafetcher/schema/atmos/manifest/1.0.json
  • tests/fixtures/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
  • website/docs/stacks/_partials/_backend-config.mdx

Comment thread internal/exec/validate_stacks_test.go Outdated
Comment thread website/docs/stacks/_partials/_backend-config.mdx Outdated
Comment thread website/docs/stacks/_partials/_backend-config.mdx
@osterman

Copy link
Copy Markdown
Member

Thanks for the PR!

Rémy Macherel (@MacherelR) please address the coderabbit review comments.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.82%. Comparing base (21c5899) to head (3ba876f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2920      +/-   ##
==========================================
- Coverage   82.83%   82.82%   -0.02%     
==========================================
  Files        1866     1866              
  Lines      181277   181277              
==========================================
- Hits       150160   150135      -25     
- Misses      23313    23327      +14     
- Partials     7804     7815      +11     
Flag Coverage Δ
unittests 82.82% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

patch A minor, backward compatible change size/m Medium size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing http as backend type

2 participants