Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
components
OpenTofu
Commits
ab291134
Unverified
Commit
ab291134
authored
11 months ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Document HTTP backend and module registry integration
parent
2f922a74
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab/README.md.template
+28
-0
28 additions, 0 deletions
.gitlab/README.md.template
README.md
+28
-0
28 additions, 0 deletions
README.md
with
56 additions
and
0 deletions
.gitlab/README.md.template
+
28
−
0
View file @
ab291134
...
@@ -97,6 +97,34 @@ fmt:
...
@@ -97,6 +97,34 @@ fmt:
...
...
```
```
### GitLab-managed Terraform state backend
This component - by leveraging the [`gitlab-tofu`](src/gitlab-tofu.sh) CLI internally -
automatically configures the
[GitLab-managed Terraform state backend](https://docs.gitlab.com/ee/user/infrastructure/iac/terraform_state.html).
The only thing required is that the Terraform configuration must specify an empty `http` backend block, like this:
```hcl
terraform {
backend "http" {}
}
```
We recommend having a dedicated `backend.tf` file inside your `root_dir`
with the aforementioned block.
### Access to Terraform Module Registry
Similar to automatically configuring the [GitLab-managed Terraform state backend]
the component also sets up credentials to authenticate with the
[Terraform Module Registry](https://docs.gitlab.com/ee/user/packages/terraform_module_registry/)
of the project the pipeline runs in.
It basically sets the `TF_TOKEN_<domain>` variable to the `$CI_JOB_TOKEN`, where `<domain>` is
the GitLab instance domain, for example for GitLab.com this would set `TF_TOKEN_gitlab_com` to
the `$CI_JOB_TOKEN`. However, it'll only do so if the variable is not already provided.
Thus, if you want to authenticate differently or to another Terraform Module Registry,
you may just provide the `TF_TOKEN_<domain>` variable yourself, e.g. via CI/CD variables.
### Opinionated Templates
### Opinionated Templates
This component repository also provides some templates that may often be used,
This component repository also provides some templates that may often be used,
...
...
This diff is collapsed.
Click to expand it.
README.md
+
28
−
0
View file @
ab291134
...
@@ -99,6 +99,34 @@ fmt:
...
@@ -99,6 +99,34 @@ fmt:
...
...
```
```
### GitLab-managed Terraform state backend
This component - by leveraging the
[
`gitlab-tofu`
](
src/gitlab-tofu.sh
)
CLI internally -
automatically configures the
[
GitLab-managed Terraform state backend
](
https://docs.gitlab.com/ee/user/infrastructure/iac/terraform_state.html
)
.
The only thing required is that the Terraform configuration must specify an empty
`http`
backend block, like this:
```
hcl
terraform
{
backend
"http"
{}
}
```
We recommend having a dedicated
`backend.tf`
file inside your
`root_dir`
with the aforementioned block.
### Access to Terraform Module Registry
Similar to automatically configuring the [GitLab-managed Terraform state backend]
the component also sets up credentials to authenticate with the
[
Terraform Module Registry
](
https://docs.gitlab.com/ee/user/packages/terraform_module_registry/
)
of the project the pipeline runs in.
It basically sets the
`TF_TOKEN_<domain>`
variable to the
`$CI_JOB_TOKEN`
, where
`<domain>`
is
the GitLab instance domain, for example for GitLab.com this would set
`TF_TOKEN_gitlab_com`
to
the
`$CI_JOB_TOKEN`
. However, it'll only do so if the variable is not already provided.
Thus, if you want to authenticate differently or to another Terraform Module Registry,
you may just provide the
`TF_TOKEN_<domain>`
variable yourself, e.g. via CI/CD variables.
### Opinionated Templates
### Opinionated Templates
This component repository also provides some templates that may often be used,
This component repository also provides some templates that may often be used,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment