All my terraform files start with:
terraform {
required_version = ">= 0.11, < 0.12"
backend "s3" {
bucket = "my-terraform-state"
key = "my-service/my-component/terraform.tfstate"
region = "eu-west-1"
encrypt = "true"
}
}
provider "aws" {
region = "eu-west-1"
version = ">= 1.8, < 1.9"
}
What I would like is something like
module "header" {
source = "module-location"
region = "eu-west-1"
state_key = "my-service/my-component"
}
When I try something like this it fails with the message that the backend configuration cannot contain variables. I also read about the read-only state and noticed that it can contain variables.