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" {
I believe the problem with the earlier example is that it’s trying to incorporate a whole kubeconfig document into a JSON string without encoding, using just string interpolation.
I have been attemtping jsondecode but I get a different error
│ Error: Error in function call
│
│ on main.tf line 11, in resource “vault_generic_secret” “main”:
│ 11: data_json = jsondecode(azurerm_kubernetes_cluster.main.kube_config_raw)
│ ├────────────────
│ │ azurerm_kubernetes_cluster.main.kube_config_raw has a sensitive value
│
│ Call to function “jsondecode” failed: invalid character ‘a’ looking for
│ beginning of value.