hashicorp / terraform-provider-vault

Terraform Vault provider
https://www.terraform.io/docs/providers/vault/
Mozilla Public License 2.0
457 stars 536 forks source link

Vault 22912/sync config #2125

Closed maxcoulombe closed 7 months ago

maxcoulombe commented 7 months ago

Description

This PR adds a resource to manage the global config of the enterprise Secrets Sync feature.

This API is only available on the root namespace so using a provider defined on a different namespace will error during the creation. Let me know if this is something that could/should be covered by automated tests.

Since the config is global, in theory it should not be possible to define this resource twice for the same Vault cluster but I'm not sure this is something that can be prevented as code. If a user defines the resource twice, the last config to be applied will be effective.

Checklist

/usr/local/go/bin/go tool test2json -t /home/max/.cache/JetBrains/GoLand2023.2/tmp/GoLand/___TestSecretsSyncConfig_in_github_com_hashicorp_terraform_provider_vault_vault.test -test.v -test.paniconexit0 -test.run ^\QTestSecretsSyncConfig\E$
=== RUN   TestSecretsSyncConfig
    resource_secrets_sync_config_test.go:22: Vault server version "1.16.0-beta1+ent"
--- PASS: TestSecretsSyncConfig (1.07s)
PASS
maxcoulombe commented 7 months ago

Whenever you get the time, could we also add the documentation for this resource to close out the loop on development?

Done!

maxcoulombe commented 7 months ago

@vinay-gopalan I added the doc so I'll go ahead and merge the PR so it is ready to ship with the rest of the TFVP support. Let me know if the explanation for the default value make sense. If you'd like to discuss a different approach or there are other adjustments to do on the config resource please ping me, I'll fix them in a follow-up PR!