Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • auto-apply-for-backports
  • deploy-refactor
  • destroy-pipeline
  • destroy-plan
  • fix-readme-path
  • main
  • no-rules-in-job-templates
  • subdir
  • 0.0.0-alpha1
  • 0.1.0
  • 0.1.0-alpha1
  • 0.1.0-alpha10
  • 0.1.0-alpha11
  • 0.1.0-alpha12
  • 0.1.0-alpha2
  • 0.1.0-alpha3
  • 0.1.0-alpha4
  • 0.1.0-alpha5
  • 0.1.0-alpha6
  • 0.1.0-alpha7
  • 0.1.0-alpha8
  • 0.1.0-alpha9
  • 0.10.0
  • 0.10.0-rc1
  • 0.10.0-rc2
  • 0.11.0
  • 0.11.0-rc1
  • 0.12.0
  • 0.13.0
  • 0.14.0
  • 0.15.0
  • 0.16.0
  • 0.17.0
  • 0.18.0
  • 0.18.0-rc1
  • 0.18.0-rc2
  • 0.18.0-rc3
  • 0.18.0-rc4
  • 0.18.0-rc5
  • 0.19.0
  • 0.19.0-rc1
  • 0.2.0
  • 0.20.0
  • 0.21.0
  • 0.22.0
  • 0.22.0-rc1
  • 0.22.0-rc2
  • 0.22.0-rc3
  • 0.22.0-rc4
  • 0.23.0
  • 0.24.0
  • 0.24.0-rc1
  • 0.25.0
  • 0.26.0
  • 0.27.0
  • 0.28.0
  • 0.29.0
  • 0.3.0
  • 0.3.0-alpha1
  • 0.3.0-alpha10
  • 0.3.0-alpha2
  • 0.3.0-alpha3
  • 0.3.0-alpha4
  • 0.3.0-alpha5
  • 0.3.0-alpha6
  • 0.3.0-alpha7
  • 0.3.0-alpha8
  • 0.3.0-alpha9
  • 0.30.0
  • 0.31.0
  • 0.32.0
  • 0.33.0
  • 0.34.0
  • 0.34.0-rc1
  • 0.35.0
  • 0.35.0-rc1
  • 0.35.0-rc2
  • 0.35.0-rc3
  • 0.35.0-rc4
  • 0.35.0-rc5
  • 0.35.0-rc6
  • 0.36.0
  • 0.37.0
  • 0.37.0-rc2
  • 0.37.0-rc3
  • 0.37.0-rc4
  • 0.37.0-rc5
  • 0.37.0-rc6
  • 0.37.0-rc7
  • 0.38.0
  • 0.39.0
  • 0.39.0-rc1
  • 0.39.0-rc2
  • 0.4.0
  • 0.4.0-alpha1
  • 0.40.0
  • 0.40.0-rc1
  • 0.40.0-rc2
  • 0.40.0-rc3
  • 0.40.0-rc4
  • 0.40.0-rc5
  • 0.40.0-rc6
  • 0.40.0-rc7
  • 0.41.0
  • 0.42.0
  • 0.42.0-rc1
  • 0.42.0-rc2
  • 0.42.0-rc3
108 results

Target

Select target project
  • components/opentofu
1 result
Select Git revision
  • auto-apply-for-backports
  • deploy-refactor
  • destroy-pipeline
  • destroy-plan
  • fix-readme-path
  • main
  • no-rules-in-job-templates
  • subdir
  • 0.0.0-alpha1
  • 0.1.0
  • 0.1.0-alpha1
  • 0.1.0-alpha10
  • 0.1.0-alpha11
  • 0.1.0-alpha12
  • 0.1.0-alpha2
  • 0.1.0-alpha3
  • 0.1.0-alpha4
  • 0.1.0-alpha5
  • 0.1.0-alpha6
  • 0.1.0-alpha7
  • 0.1.0-alpha8
  • 0.1.0-alpha9
  • 0.10.0
  • 0.10.0-rc1
  • 0.10.0-rc2
  • 0.11.0
  • 0.11.0-rc1
  • 0.12.0
  • 0.13.0
  • 0.14.0
  • 0.15.0
  • 0.16.0
  • 0.17.0
  • 0.18.0
  • 0.18.0-rc1
  • 0.18.0-rc2
  • 0.18.0-rc3
  • 0.18.0-rc4
  • 0.18.0-rc5
  • 0.19.0
  • 0.19.0-rc1
  • 0.2.0
  • 0.20.0
  • 0.21.0
  • 0.22.0
  • 0.22.0-rc1
  • 0.22.0-rc2
  • 0.22.0-rc3
  • 0.22.0-rc4
  • 0.23.0
  • 0.24.0
  • 0.24.0-rc1
  • 0.25.0
  • 0.26.0
  • 0.27.0
  • 0.28.0
  • 0.29.0
  • 0.3.0
  • 0.3.0-alpha1
  • 0.3.0-alpha10
  • 0.3.0-alpha2
  • 0.3.0-alpha3
  • 0.3.0-alpha4
  • 0.3.0-alpha5
  • 0.3.0-alpha6
  • 0.3.0-alpha7
  • 0.3.0-alpha8
  • 0.3.0-alpha9
  • 0.30.0
  • 0.31.0
  • 0.32.0
  • 0.33.0
  • 0.34.0
  • 0.34.0-rc1
  • 0.35.0
  • 0.35.0-rc1
  • 0.35.0-rc2
  • 0.35.0-rc3
  • 0.35.0-rc4
  • 0.35.0-rc5
  • 0.35.0-rc6
  • 0.36.0
  • 0.37.0
  • 0.37.0-rc2
  • 0.37.0-rc3
  • 0.37.0-rc4
  • 0.37.0-rc5
  • 0.37.0-rc6
  • 0.37.0-rc7
  • 0.38.0
  • 0.39.0
  • 0.39.0-rc1
  • 0.39.0-rc2
  • 0.4.0
  • 0.4.0-alpha1
  • 0.40.0
  • 0.40.0-rc1
  • 0.40.0-rc2
  • 0.40.0-rc3
  • 0.40.0-rc4
  • 0.40.0-rc5
  • 0.40.0-rc6
  • 0.40.0-rc7
  • 0.41.0
  • 0.42.0
  • 0.42.0-rc1
  • 0.42.0-rc2
  • 0.42.0-rc3
108 results
Show changes
Commits on Source (2)
......@@ -197,6 +197,12 @@ three things:
1. set the `enable_id_tokens` input to `true`.
2. configure the `.gitlab-tofu:id_tokens` job with your desired `id_tokens` setup.
- This `.gitlab-tofu:id_tokens` behind the scenes will be used as the base job for the
actual tofu jobs, like `plan`, thus some CI keywords maybe overwritten by it, like
`before_script` or `script`. We recommend to focus on `id_tokens` related keywords, specifically:
- `id_tokens`
- `secrets`
- `variables`
3. (optionally) provide the `.gitlab/ci/setup-id-tokens.sh` script to configure things,
like assuming IAM roles.
......@@ -235,6 +241,43 @@ aws sts get-caller-identity
You might configure the name of the `id_tokens` job and the setup script location
with the `id_tokens_base_job_name` and `id_tokens_setup_script` inputs, respectively.
#### External integration to pull secrets for tofu (providers)
You can easily integrate with external secret providers,
like a Vault / OpenBao instance using `id_tokens` in combination with `secrets`.
> [!tip]
> Also have a look at [Using external secrets in CI](https://docs.gitlab.com/ci/secrets/).
For example, you may configure the `aws` provider with a `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` assuming their values are stored in `production/aws/AWS_ACCESS_KEY_ID@ops`
and `production/aws/AWS_SECRET_ACCESS_KEY@ops` (where `production/aws` is the path to the secret,
the `AWS_*` are the field names and `ops` is the path where the secrets engine is mounted):
```yaml
include:
- component: $CI_SERVER_FQDN/components/opentofu/validate-plan-apply@<VERSION>
inputs:
opentofu_version: <OPENTOFU_VERSION>
enable_id_tokens: true
stages: [validate, build, deploy]
.gitlab-tofu:id_tokens:
id_tokens:
VAULT_ID_TOKEN:
aud: https://vault.example.com
secrets:
AWS_ACCESS_KEY_ID:
vault: production/aws/AWS_ACCESS_KEY_ID@ops
token: $VAULT_ID_TOKEN
file: false
AWS_SECRET_ACCESS_KEY:
vault: production/aws/AWS_SECRET_ACCESS_KEY@ops
token: $VAULT_ID_TOKEN
file: false
```
### Access to Terraform Module Registry
Similar to automatically configuring the [GitLab-managed Terraform state backend]
......
......@@ -199,6 +199,12 @@ three things:
1. set the `enable_id_tokens` input to `true`.
2. configure the `.gitlab-tofu:id_tokens` job with your desired `id_tokens` setup.
- This `.gitlab-tofu:id_tokens` behind the scenes will be used as the base job for the
actual tofu jobs, like `plan`, thus some CI keywords maybe overwritten by it, like
`before_script` or `script`. We recommend to focus on `id_tokens` related keywords, specifically:
- `id_tokens`
- `secrets`
- `variables`
3. (optionally) provide the `.gitlab/ci/setup-id-tokens.sh` script to configure things,
like assuming IAM roles.
......@@ -237,6 +243,43 @@ aws sts get-caller-identity
You might configure the name of the `id_tokens` job and the setup script location
with the `id_tokens_base_job_name` and `id_tokens_setup_script` inputs, respectively.
#### External integration to pull secrets for tofu (providers)
You can easily integrate with external secret providers,
like a Vault / OpenBao instance using `id_tokens` in combination with `secrets`.
> [!tip]
> Also have a look at [Using external secrets in CI](https://docs.gitlab.com/ci/secrets/).
For example, you may configure the `aws` provider with a `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` assuming their values are stored in `production/aws/AWS_ACCESS_KEY_ID@ops`
and `production/aws/AWS_SECRET_ACCESS_KEY@ops` (where `production/aws` is the path to the secret,
the `AWS_*` are the field names and `ops` is the path where the secrets engine is mounted):
```yaml
include:
- component: $CI_SERVER_FQDN/components/opentofu/validate-plan-apply@<VERSION>
inputs:
opentofu_version: <OPENTOFU_VERSION>
enable_id_tokens: true
stages: [validate, build, deploy]
.gitlab-tofu:id_tokens:
id_tokens:
VAULT_ID_TOKEN:
aud: https://vault.example.com
secrets:
AWS_ACCESS_KEY_ID:
vault: production/aws/AWS_ACCESS_KEY_ID@ops
token: $VAULT_ID_TOKEN
file: false
AWS_SECRET_ACCESS_KEY:
vault: production/aws/AWS_SECRET_ACCESS_KEY@ops
token: $VAULT_ID_TOKEN
file: false
```
### Access to Terraform Module Registry
Similar to automatically configuring the [GitLab-managed Terraform state backend]
......