Complete the code to declare a Vault provider in Terraform.
provider "vault" { address = "[1]" }
The Vault provider requires the Vault server address. "http://localhost:8200" is the default Vault server URL.
Complete the code to read a secret from Vault using Terraform data source.
data "vault_generic_secret" "example" { path = "[1]" }
The path "secret/data/myapp/config" is the correct Vault KV v2 path format to read secrets.
Fix the error in the Terraform code to retrieve AWS Secrets Manager secret.
data "aws_secretsmanager_secret_version" "example" { secret_id = [1] }
The secret_id must be a string literal with the secret's ID or ARN, so it needs quotes around it.
Fill both blanks to define a Vault secret resource with a dynamic key and value.
resource "vault_generic_secret" "example" { path = "secret/data/[1]" data_json = jsonencode({ [2] = "mysecretvalue" }) }
The path should be "secret/data/myapp" and the key inside the secret data should be "password" to store the secret value.
Fill all three blanks to output the secret value from Vault data source in Terraform.
output "db_password" { value = data.vault_generic_secret.[1].data.[2]["[3]"] }
The data source name is "example", the Vault KV v2 secret data is under "data", and the key for the password is "password".