Being new to Terraform, I’m still in the stage of not knowing much. Hence why my question to clarify my current understanding.
Is possible to reference a ‘backend’ block value? Would be helpful to add a tag value to resources of the associated statefile, but currently thinking this isn’t possible in any way - even with declaring a partial configuration and put the key value in a separate file. Trying to keep the file DRY by not having to declare the same value twice.
terraform {
backend “s3” {
bucket = “xxxxxxxx”
key = “xxxxxxxx”
region = “xx-xxxx-x”
dynamodb_table = “xxxxxxxx”
}
}
provider “aws” {
default_tags {
tags = {
“terraform” = terrafrom.backend.s3.key
}
}
}
TIA.