-
Notifications
You must be signed in to change notification settings - Fork 553
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 redis elasticache database plugin support #1596
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I think you also need a setRedisElastiCacheConnectionData
function that reads the data from the TF config. This method can then be called from getDatabaseAPIDataForEngine
as done here: https://github.com/hashicorp/terraform-provider-vault/blob/main/vault/resource_database_secret_backend_connection.go#L833
Thanks for catching that. Out of curiosity whats the functional purpose of adding that? It seems like everything was working fine including showing the diff during updates and populating the statefile so I'm wondering what use case can I use to validate it's working as intended? |
Good question! I believe in the context of your test, the SDK was mainly only checking if the respective fields are populated with the particular values within the resource diff and state, and hence the test passes. However, since we never actually read those values from the resource diff and write them to Vault, an Import TestStep would show that the test would fail. Import tests read the resource from Vault and verify the values are the what we expect them to be, thereby providing a more complete loop on the test. Here's an example of an import test for a DB engine: https://github.com/hashicorp/terraform-provider-vault/blob/main/vault/resource_database_secret_backend_connection_test.go#L247-L252 |
Thanks for the link to the example. Everything seems fine now and the test pass.
Imports also work as expected if I try it manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just have a few issues/nits/suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after updating the import to ignore redis password and adding the docs!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* + added redis elasticache database plugin support
Note: this feature requires Vault Server 1.12.0 or greater. The targeted GA date for Vault 1.12.0 is Oct. 12th, 2022.
Release note for CHANGELOG:
Output from acceptance testing:
Config example: