How do I add a variable to an s3endpoint

unfortunately the terraform backend { does not allow variables

Error: Variables not allowed

on instance.tf line 14, in terraform:
14: key = local.interpolated

code below:

locals {
base = “global/s3/instance/terraform.tfstate”
interpolated = “global/s3/${var.instancename}/terraform.tfstate”

}

terraform {
backend “s3” {
# Replace this with your bucket name!
# need to strip white spaces
bucket = “xxxx”
key = local.interpolated
region = “eu-west-2”
}
}