Save kubeconfig yaml to vault via terraform


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

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}"

  depends_on = [ vault_mount.kvv2 ]


Error: invalid character '\n' in string literal

  on line 61, in resource "vault_generic_secret" "vault_secret_kvv2_new":
  61: resource "vault_generic_secret" "vault_secret_kvv2_new" {