Skip to content

Add support for configuring a DB secret's plugin_name - #1320

Merged
benashz merged 11 commits into
mainfrom
VAULT-4703/add-db-plugin-name
Jan 29, 2022
Merged

benashz merged 11 commits into
mainfrom
VAULT-4703/add-db-plugin-name

Conversation

@benashz

@benashz benashz commented Jan 26, 2022

Copy link
Copy Markdown
Collaborator

This PR adds support for setting the plugin_name in the vault_database_secret_backend_connection resource. Previously all related resources could only be provisioned using a well known default value from Vault.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #1288

Release note for CHANGELOG:


Output from acceptance testing:

make testacc TESTARGS='-v -test.run TestAccDatabaseSecretBackendConnection_mssql'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -v -v -test.run TestAccDatabaseSecretBackendConnection_mssql -timeout 20m ./...

[...]

=== RUN   TestAccDatabaseSecretBackendConnection_mssql
--- PASS: TestAccDatabaseSecretBackendConnection_mssql (17.70s)

Comment thread vault/resource_database_secret_backend_connection_test.go

@vinay-gopalan vinay-gopalan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Had 1 query about a test with a custom plugin name, but I'm good with the rest

Comment thread vault/resource_database_secret_backend_connection_test.go
@benashz
benashz requested a review from vinay-gopalan January 28, 2022 19:05

@calvn calvn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor nits, otherwise looks good! There's a bit of redundancy between the consts, the map, and the slice that we build, but we've discussed online that you plan on refactoring those bits separately.

Comment thread vault/resource_database_secret_backend_connection.go Outdated
Comment thread vault/resource_database_secret_backend_connection.go
* Use dbEngine instances in place of constants.

- replace the use of map for looking up dbEngine instances by name with
  a slice
- factor out dbBackend* constants to dbEngine instances.

* Use dbEngine names in db Schema fields.

* Add some public getter methods to the dbEngine
@benashz
benashz merged commit 0d2c0e4 into main Jan 29, 2022
@benashz
benashz deleted the VAULT-4703/add-db-plugin-name branch January 29, 2022 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

database_secret_backend_connection resource missing plugin_name field.

3 participants