Installation & configuration
Install
Section titled “Install”The provider is published as entrepotproj/entrepot to both registries from
the same signed GitHub releases. Declare it in required_providers; the
source address is the same for both tools.
terraform { required_version = ">= 1.5" required_providers { entrepot = { source = "entrepotproj/entrepot" # registry.terraform.io/entrepotproj/entrepot version = "~> 0.1" } }}terraform initterraform { required_version = ">= 1.8" required_providers { entrepot = { source = "entrepotproj/entrepot" # registry.opentofu.org/entrepotproj/entrepot version = "~> 0.1" } }}tofu initCommit the generated .terraform.lock.hcl so every run uses the same
provider build.
Credentials
Section titled “Credentials”-
Create a service account for Terraform and make it an administrator (Terraform manages blob stores, repositories and security settings, which need system admin):
Terminal window E=https://entrepot.example.comcurl -fsS -H "Authorization: Bearer $BOOTSTRAP_TOKEN" -X POST $E/api/v1/service-accounts -d '{"name":"terraform"}'curl -fsS -H "Authorization: Bearer $BOOTSTRAP_TOKEN" -X POST $E/api/v1/role-bindings \-d '{"role":"admin","subjectType":"user","subject":"sa:terraform","repositoryPattern":"*"}'curl -fsS -H "Authorization: Bearer $BOOTSTRAP_TOKEN" -X POST $E/api/v1/service-accounts/terraform/tokens \-d '{"name":"ci","expiresInDays":180}' | jq -r .secret -
Give the token to the provider through the environment:
Terminal window export ENTREPOT_URL=https://entrepot.example.comexport ENTREPOT_TOKEN=ent_…terraform plan
In CI, GitLab jobs can use their id_token instead of a stored token: bind
admin on * to a trust policy that
matches only your infrastructure project’s protected branch, and export the
id_token as ENTREPOT_TOKEN.
apply: image: ghcr.io/opentofu/opentofu:latest id_tokens: ENTREPOT_TOKEN: aud: https://entrepot.example.com variables: ENTREPOT_URL: https://entrepot.example.com script: - tofu init - tofu apply -auto-approve rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCHProvider configuration
Section titled “Provider configuration”provider "entrepot" { url = "https://entrepot.example.com" # or ENTREPOT_URL token = var.entrepot_token # or ENTREPOT_TOKEN
# Optional ca_cert_pem = file("internal-ca.pem") timeout_seconds = 120}| Argument | Env | Description |
|---|---|---|
url |
ENTREPOT_URL |
Base URL of the server, e.g. https://entrepot.example.com. |
token |
ENTREPOT_TOKEN |
API token: a service-account token (ent_…, recommended), an OIDC access token, a GitLab id_token or the bootstrap token. Sensitive. |
ca_cert_pem |
— | PEM CA certificate(s) to trust in addition to the system roots. |
insecure_skip_verify |
— | Disable TLS verification (testing only). |
timeout_seconds |
— | HTTP request timeout (default 60). |
Arguments in the configuration take precedence over the environment.
Local builds
Section titled “Local builds”To test an unreleased provider build, point a dev_overrides block at it in
~/.terraformrc (OpenTofu: ~/.tofurc):
provider_installation { dev_overrides { "entrepotproj/entrepot" = "/path/to/terraform-provider-entrepot" } direct {}}