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

feat(pki): Add support to enable_templating in vault_pki_secret_backend_config_urls #2147

Merged
merged 6 commits into from
Feb 23, 2024

Conversation

Viper61
Copy link
Contributor

@Viper61 Viper61 commented Feb 17, 2024

Description

This PR adds a new option to allow configuration of the templating on the global URLs (vault_pki_secret_backend_config_urls)

Relates #1947
Closes #1983

Checklist

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

Output from acceptance testing:

# Vault 1.13
$ VAULT_ADDR=http://172.20.0.1:8213 TESTARGS="--run TestPkiSecretBackendConfigUrls_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigUrls_basic -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]
ok      github.com/hashicorp/terraform-provider-vault/codegen   0.006s [no tests to run]
?       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]
ok      github.com/hashicorp/terraform-provider-vault/internal/identity/entity  0.022s [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]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider 0.023s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.007s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.005s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     3.885s


# Vault 1.14
$ VAULT_ADDR=http://172.20.0.1:8214 TESTARGS="--run TestPkiSecretBackendConfigUrls_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigUrls_basic -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]
ok      github.com/hashicorp/terraform-provider-vault/codegen   0.008s [no tests to run]
?       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]
ok      github.com/hashicorp/terraform-provider-vault/internal/identity/entity  0.027s [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]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider 0.023s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.005s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.005s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     3.125s


# Vault 1.15
$ VAULT_ADDR=http://172.20.0.1:8215 TESTARGS="--run TestPkiSecretBackendConfigUrls_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigUrls_basic -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]
ok      github.com/hashicorp/terraform-provider-vault/codegen   0.007s [no tests to run]
?       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]
ok      github.com/hashicorp/terraform-provider-vault/internal/identity/entity  0.042s [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]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider 0.030s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.006s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.004s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     3.411s

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

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.

Thanks for the contribution @Viper61 ! Looking good so far, just a few comments.

vault/resource_pki_secret_backend_config_urls.go Outdated Show resolved Hide resolved
vault/resource_pki_secret_backend_config_urls_test.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added size/M and removed size/XS labels Feb 18, 2024
@Viper61
Copy link
Contributor Author

Viper61 commented Feb 18, 2024

Hi @fairclothjm
Requested changes were applied.

For the tests, I tried te preserve the import one for both 1.13/earlier and 1.14/newer.
Let me know if you think there is a better way to do so (or if it is not necessary).

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.

Thanks @Viper61 ! I believe enable_templating was added in Vault 1.13. Could you please update accordingly?

vault/resource_pki_secret_backend_config_urls.go Outdated Show resolved Hide resolved
vault/resource_pki_secret_backend_config_urls.go Outdated Show resolved Hide resolved
vault/resource_pki_secret_backend_config_urls_test.go Outdated Show resolved Hide resolved
vault/resource_pki_secret_backend_config_urls_test.go Outdated Show resolved Hide resolved
vault/resource_pki_secret_backend_config_urls_test.go Outdated Show resolved Hide resolved
vault/resource_pki_secret_backend_config_urls_test.go Outdated Show resolved Hide resolved
@Viper61
Copy link
Contributor Author

Viper61 commented Feb 21, 2024

I believe enable_templating was added in Vault 1.13. Could you please update accordingly?

Oh, it was added in 1.13 and was available from the CLI.
However, it wasn't showing up in the interface until 1.14.
Thanks for letting me know.

It's fixed.
Bonus : updated the doc with the new option

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! Thanks @Viper61 !

@fairclothjm fairclothjm merged commit 2c10333 into hashicorp:main Feb 23, 2024
2 checks passed
@fairclothjm fairclothjm added this to the 3.26.0 milestone Feb 23, 2024
@Viper61 Viper61 deleted the feat/pki-config-urls branch February 23, 2024 18:02
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.

vault_pki_secret_backend_config_urls should expose enable_templating setting
2 participants