Create AWS S3 resource with Terraform using interpolation

main.tf
provider "aws" {
  region = "eu-west-2"
}

data "aws_caller_identity" "current" {}

resource "aws_s3_bucket" "bucket1" {
  bucket = "${data.aws_caller_identity.current.account_id}-${var.bucket_name}" # interpolation
}

variables.tf
variable "bucket_name" {
  default = "new-bucket-name"
}

output.tf
output "created_bucket_name" {
  value = aws_s3_bucket.bucket1.bucket
}