You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite running the tofu-plan with a var file setting:
It fails at not having variables set in the initialisation, which is essential for backend configuration dependent on the environment:
Initializing OpenTofu
Initializing the backend...
Initializing modules...
...
╷
│ Error: Unable to compute static value
│
│ on provider.tf line 28, in terraform:
│ 28: backend "s3" {
│
│ backend.s3 depends on var.account_id which is not available
╵
╷
│ Error: Unable to compute static value
│
│ on provider.tf line 28, in terraform:
│ 28: backend "s3" {
│
│ backend.s3 depends on var.account_id which is not available
╵
╷
│ Error: Unable to compute static value
│
│ on provider.tf line 28, in terraform:
│ 28: backend "s3" {
│
│ backend.s3 depends on var.env which is not available
╵
╷
│ Error: Variable not provided via -var, tfvars files, or env
│
│ on variables.tf line 4:
│ 4: variable "env" {
│
╵
╷
│ Error: Variable not provided via -var, tfvars files, or env
│
│ on variables.tf line 29:
│ 29: variable "account_id" {
│
╵
╷
│ Error: Variable not provided via -var, tfvars files, or env
│
│ on variables.tf line 29:
│ 29: variable "account_id" {
│
╵
Manually running a tofu init -var-file=../vars/preprod.tfvars followed by the same for plan or apply on the other hand works without issue. Paths are correct, I double checked that. I think it just provides the vars to the apply step, which may be enough for some cases, but far from all, and providing it to init doesn't hurt in those either, but failing to do so makes it unusable for anybody configuring something like this example, where different vars point to different state buckets for example, because they are in different accounts, as is best practice.
The text was updated successfully, but these errors were encountered:
Despite running the tofu-plan with a var file setting:
It fails at not having variables set in the initialisation, which is essential for backend configuration dependent on the environment:
Manually running a
tofu init -var-file=../vars/preprod.tfvars
followed by the same for plan or apply on the other hand works without issue. Paths are correct, I double checked that. I think it just provides the vars to the apply step, which may be enough for some cases, but far from all, and providing it to init doesn't hurt in those either, but failing to do so makes it unusable for anybody configuring something like this example, where different vars point to different state buckets for example, because they are in different accounts, as is best practice.The text was updated successfully, but these errors were encountered: