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 credential_type and credential_config to static roles for DBs #2384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

catouc
Copy link

@catouc catouc commented Dec 19, 2024

Description

An attempt to add credential_type and credential_config as fields to the static roles in database engines.

This is to enable support for using rsa_public_key on Snowflake secret engines which is currently not possible on static roles.

Closes #1585.

Checklist

  • Added CHANGELOG entry (only for user-facing changes)
  • Acceptance tests where run against all supported Vault Versions

Output from acceptance testing:

pboeschen@LL16KDB44 terraform-provider-vault main> RUNS_IN_CONTAINER=true make testacc TESTARGS='-run=TestAccDatabaseSecretBackendStaticRole.* -v'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -run=TestAccDatabaseSecretBackendStaticRole.* -v -timeout 30m ./...
?   	github.com/hashicorp/terraform-provider-vault	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/cmd/coverage	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/cmd/generate	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/helper	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/internal/consts	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/internal/identity/group	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/internal/identity/mfa	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/internal/pki	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/codegen	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/internal/identity/entity	(cached) [no tests to run]
?   	github.com/hashicorp/terraform-provider-vault/internal/sync	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/schema	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/internal/provider	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/testutil	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/util	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/util/mountutil	(cached) [no tests to run]
=== RUN   TestAccDatabaseSecretBackendStaticRole_import
--- PASS: TestAccDatabaseSecretBackendStaticRole_import (1.76s)
=== RUN   TestAccDatabaseSecretBackendStaticRole_credentialType
--- PASS: TestAccDatabaseSecretBackendStaticRole_credentialType (1.43s)
=== RUN   TestAccDatabaseSecretBackendStaticRole_credentialConfig
--- PASS: TestAccDatabaseSecretBackendStaticRole_credentialConfig (2.46s)
=== RUN   TestAccDatabaseSecretBackendStaticRole_rotationPeriod
--- PASS: TestAccDatabaseSecretBackendStaticRole_rotationPeriod (2.45s)
=== RUN   TestAccDatabaseSecretBackendStaticRole_rotationSchedule
    resource_database_secret_backend_static_role_test.go:197: Vault server version "1.18.2"
--- PASS: TestAccDatabaseSecretBackendStaticRole_rotationSchedule (2.47s)
=== RUN   TestAccDatabaseSecretBackendStaticRole_Rootless
    resource_database_secret_backend_static_role_test.go:234: "POSTGRES_URL_TEST" must be set
--- SKIP: TestAccDatabaseSecretBackendStaticRole_Rootless (0.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-vault/vault	10.614s

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

@catouc catouc requested a review from a team as a code owner December 19, 2024 09:33
@catouc catouc requested a review from JMGoldsmith December 19, 2024 09:33
Copy link

hashicorp-cla-app bot commented Dec 19, 2024

CLA assistant check
All committers have signed the CLA.

@catouc catouc force-pushed the main branch 2 times, most recently from ea109b6 to a2ac1e7 Compare December 19, 2024 12:58
@catouc
Copy link
Author

catouc commented Dec 19, 2024

Unsure what "all supported Vault versions" are so I ran my tests against 1.18.2 locally. https://registry.terraform.io/providers/hashicorp/vault/latest/docs does not list any supported versions. Nor in the README from what I can tell.

@catouc catouc changed the title Draft: Add credential_type and credential_config to static roles for DBs Add credential_type and credential_config to static roles for DBs Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform cannot provision snowflake secret engine role with credential_type="rsa_public_key"
1 participant