Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configuring username and password fields for select DB Engines #1331

Merged
merged 13 commits into from
Feb 10, 2022

Conversation

vinay-gopalan
Copy link
Contributor

@vinay-gopalan vinay-gopalan commented Feb 2, 2022

This PR adds support for configuring the username and password fields in Vault through the Provider for all DB Engines that support those fields (all DBs except MongoDB Atlas)

Relates OR Closes #1314 #1329

Release note for CHANGELOG:

`resource/database_secret_backend_connection`: Add `username` and `password` fields to all DB engines that support them

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccDatabaseSecretBackendConnection_mssql'
=== RUN   TestAccDatabaseSecretBackendConnection_mssql
--- PASS: TestAccDatabaseSecretBackendConnection_mssql (12.10s)
PASS

$ make testacc TESTARGS='-run=TestAccDatabaseSecretBackendConnection_postgresql'
=== RUN   TestAccDatabaseSecretBackendConnection_postgresql
--- PASS: TestAccDatabaseSecretBackendConnection_postgresql (12.10s)

make testacc TESTARGS='-run=TestAccDatabaseSecretBackendConnection_mysql'
=== RUN   TestAccDatabaseSecretBackendConnection_mysql
--- PASS: TestAccDatabaseSecretBackendConnection_mysql (5.52s)
PASS

@github-actions github-actions bot added the size/M label Feb 2, 2022
@github-actions github-actions bot added size/L and removed size/M labels Feb 4, 2022
Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

Looks Great!

@github-actions github-actions bot added size/XL and removed size/L labels Feb 4, 2022
Comment on lines -591 to -593
resource.TestCheckResourceAttr(testDefaultDatabaseSecretBackendResource, "data.%", "2"),
resource.TestCheckResourceAttr(testDefaultDatabaseSecretBackendResource, "data.username", testUsername),
resource.TestCheckResourceAttr(testDefaultDatabaseSecretBackendResource, "data.password", testPassword),
Copy link
Contributor

Choose a reason for hiding this comment

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

So these are unrelated to this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are to be removed since username and password are now being set on the resource config itself, though how these data fields are passed to Vault, I am slightly unclear on

@benashz benashz self-requested a review February 4, 2022 23:09
Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

Ship it!

@vinay-gopalan vinay-gopalan merged commit 5c3e22b into main Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The PostgresQL resource is not able to rotate the root password due to missing username
2 participants