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

Bring the Vault provider to gcp sql parity with Vault #2012

Merged
merged 13 commits into from
Oct 2, 2023

Conversation

kpcraig
Copy link
Contributor

@kpcraig kpcraig commented Sep 13, 2023

This PR adds the two fields for mysql and postgres databases that were added in vault 1.15 to allow Vault to use GCP IAM roles to access databases.

The change on vault added two fields, "auth_type", for which the currently only valid values is "gcp_iam", and "service_account_json", for supplying a specific json encoding of an access token.

@github-actions github-actions bot added size/L and removed size/M labels Sep 13, 2023
@@ -752,6 +754,20 @@ func connectionStringResource(config *connectionStringConfig) *schema.Resource {
}
}

if config.isCloud {
res.Schema["auth_type"] = &schema.Schema{
Copy link
Contributor

@Zlaticanin Zlaticanin Sep 28, 2023

Choose a reason for hiding this comment

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

Small nit, but should we maybe use constants for these fields? We can add them to the internal/consts.go where we keep most of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we could - it didn't match with the rest of the file so i didn't commit.

Copy link
Contributor

@fairclothjm fairclothjm left a comment

Choose a reason for hiding this comment

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

LGTM, can we rebase this against main once #2035 is merged?

Copy link
Contributor

@vinay-gopalan vinay-gopalan 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! Had one last comment on version checking in the get methods, but good to go otherwise. Thanks for working through this!

vault/resource_database_secret_backend_connection.go Outdated Show resolved Hide resolved
@vinay-gopalan vinay-gopalan added this to the 3.21.0 milestone Oct 2, 2023
@kpcraig kpcraig merged commit 7f71cc3 into main Oct 2, 2023
10 checks passed
@kpcraig kpcraig deleted the VAULT-18401/gcp-sql-parity branch October 2, 2023 23:03
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.

4 participants