d1aef45d1d
The module's versions.tf and the root.hcl-generated backend.tf both
declared required_providers, which OpenTofu rejects ("A module may have
only one required providers configuration"), so terragrunt init/plan
failed. Keep them in the module's versions.tf (authentik + vault) and
generate only the backend + provider blocks.
33 lines
883 B
HCL
33 lines
883 B
HCL
generate "backend" {
|
|
path = "backend.tf"
|
|
if_exists = "overwrite"
|
|
contents = <<EOF
|
|
provider "authentik" {
|
|
url = "https://${path_relative_to_include()}"
|
|
token = var.authentik_token
|
|
}
|
|
|
|
# Reads client secrets seeded in Vault (kv-v2). Auth via VAULT_ADDR + VAULT_TOKEN
|
|
# from the environment (set by the Makefile vault_env helper).
|
|
provider "vault" {}
|
|
|
|
variable "authentik_token" {
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
terraform {
|
|
backend "consul" {
|
|
address = "https://consul.service.consul"
|
|
path = "infra/terraform/authentik/${path_relative_to_include()}/state"
|
|
scheme = "https"
|
|
lock = true
|
|
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
|
|
}
|
|
required_version = ">= 1.10"
|
|
# required_providers are declared in the module's versions.tf; declaring them
|
|
# here as well is a duplicate configuration (OpenTofu permits only one).
|
|
}
|
|
EOF
|
|
}
|