Save kubeconfig yaml to vault via terraform

Hi.

How do i use Terraform vault provider to write a k8s config under a KV2 engine using
vault_generic_secret under terraform

https://registry.terraform.io/providers/hashicorp/vault/latest/docs/resources/generic_secret

Is it also possible to read the value of the K8 kubeconfig from a file and substitute the value for the key?

I am trying the following

data "local_file" "input" {
    filename = var.shoot_kubeconfig_path
}

resource "vault_generic_secret" "vault_secret_kvv2_new" {
  provider = vault.child_namespace
  path = join("/", [ var.kvv2_secret_path, "config2" ])

  data_json = <<EOT
{
  "foo":  "${data.local_file.input.content}"
}
EOT

  depends_on = [ vault_mount.kvv2 ]
}

Error

Error: invalid character '\n' in string literal

  on main.tf line 61, in resource "vault_generic_secret" "vault_secret_kvv2_new":
  61: resource "vault_generic_secret" "vault_secret_kvv2_new" {

Kevin