we are trying to create keyvault secret using Terraform at runtime and we after building the code, it looks something like this
resource “azurerm_key_vault_secret” “AggregatorsKeySpaceName” {
name = “AggregatorsKeySpaceName”
value = <<EOT
KV_SECRET_VALUE
EOT
key_vault_id = azurerm_key_vault.keyvault.id
}
the issue is that, heredoc syntax adds a trailing new line at the end of the “value”, hence the value is stored something like this
As you can in the image, the secret value 5 is trailed with new line and it kind of changes the meaning of the secret value in case of passwords and other KV secret stored.