Skip to content

Commit 66f66a4

Browse files
ostermanclaude
andcommitted
docs(stacks): document the HTTP backend
Adds an HTTP Backend section to the backend-config partial, folded in from @MacherelR's PR #2920 (which this PR supersedes with a broader fix covering http plus 5 other missing backend types across all 3 schema copies). Credits the original contribution rather than losing it when superseding the PR. Co-Authored-By: Claude Sonnet 5 <[email protected]>
1 parent 034460c commit 66f66a4

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

‎website/docs/stacks/_partials/_backend-config.mdx‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,54 @@ For development or single-user scenarios:
272272
</TabItem>
273273
</Tabs>
274274

275+
### HTTP Backend
276+
277+
For state stored behind a generic HTTP endpoint, such as [GitLab-managed Terraform state](https://docs.gitlab.com/user/infrastructure/iac/terraform_state/):
278+
279+
<Tabs>
280+
<TabItem value="yaml" label="Stack Configuration" default>
281+
```yaml
282+
terraform:
283+
backend_type: http
284+
backend:
285+
http:
286+
address: "https://gitlab.example.com/api/v4/projects/123/terraform/state/vpc"
287+
lock_address: "https://gitlab.example.com/api/v4/projects/123/terraform/state/vpc/lock"
288+
unlock_address: "https://gitlab.example.com/api/v4/projects/123/terraform/state/vpc/lock"
289+
lock_method: POST
290+
unlock_method: DELETE
291+
username: gitlab-ci-token
292+
password: !env CI_JOB_TOKEN
293+
```
294+
</TabItem>
295+
<TabItem value="json" label="Generated File">
296+
```json title="components/terraform/vpc/backend.tf.json"
297+
{
298+
"terraform": {
299+
"backend": {
300+
"http": {
301+
"address": "https://gitlab.example.com/api/v4/projects/123/terraform/state/vpc",
302+
"lock_address": "https://gitlab.example.com/api/v4/projects/123/terraform/state/vpc/lock",
303+
"unlock_address": "https://gitlab.example.com/api/v4/projects/123/terraform/state/vpc/lock",
304+
"lock_method": "POST",
305+
"unlock_method": "DELETE",
306+
"username": "gitlab-ci-token",
307+
"password": "glcbt-..."
308+
}
309+
}
310+
}
311+
}
312+
```
313+
</TabItem>
314+
</Tabs>
315+
316+
:::warning
317+
`backend.tf.json` is generated with credentials expanded in plain text — in the example
318+
above, the resolved `CI_JOB_TOKEN` value. Never commit this file, log its contents, or
319+
upload it as a CI artifact. It should be excluded via `.gitignore` (Atmos regenerates it
320+
on demand when `auto_generate_backend_file` is enabled).
321+
:::
322+
275323
## Remote State Backend
276324

277325
The `remote_state_backend` configuration is separate from `backend` and controls how other components can read this component's state:

0 commit comments

Comments
 (0)