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 to vault_pki_secret_backend_config_acme max_ttl option #2411

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Bartosz-lab
Copy link

@Bartosz-lab Bartosz-lab commented Feb 23, 2025

Description

This PR updates vault_pki_secret_backend_config_acme.
Added max_ttl config option.

Relates OR Closes #2410

Checklist

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

Output from acceptance testing:

Version 1.14
VAULT_ADDR=http://localhost:8200  TESTARGS="--run TestPkiSecretBackendConfigACME_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigACME_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.022s [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.052s [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.055s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.030s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.027s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util/mountutil    0.012s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     6.624s
Version 1.15
VAULT_ADDR=http://localhost:8200  TESTARGS="--run TestPkiSecretBackendConfigACME_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigACME_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.023s [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.055s [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.048s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.022s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.028s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util/mountutil    0.008s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     5.080s
Version 1.16
VAULT_ADDR=http://localhost:8200  TESTARGS="--run TestPkiSecretBackendConfigACME_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigACME_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.021s [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]
?       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/identity/entity  0.052s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider 0.053s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.018s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.027s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util/mountutil    0.007s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     6.580s
Version 1.17
VAULT_ADDR=http://localhost:8200  TESTARGS="--run TestPkiSecretBackendConfigACME_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigACME_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.022s [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.044s [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.048s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.019s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.018s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util/mountutil    0.008s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     8.496s
Version 1.18
VAULT_ADDR=http://localhost:8200  TESTARGS="--run TestPkiSecretBackendConfigACME_basic" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test --run TestPkiSecretBackendConfigACME_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.019s [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]
?       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/identity/entity  0.039s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider 0.046s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  0.024s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      0.027s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util/mountutil    0.011s [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     8.849s

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

@Bartosz-lab Bartosz-lab requested a review from a team as a code owner February 23, 2025 15:08
Copy link

hashicorp-cla-app bot commented Feb 23, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@stevendpclark stevendpclark left a comment

Choose a reason for hiding this comment

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

Hey @Bartosz-lab, thanks for identifying this missing field within the PKI ACME configuration resource.

This needs to be tweaked a bit though in that field was only added on Vault versions 1.17 and higher so the max_ttl field needs to only send/update meta data on those Vault versions. Also the tests need to work on older Vault versions (1.14 and above)

@Bartosz-lab
Copy link
Author

Hi,
i added version checks for this field

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.

[Enhancement]: vault_pki_secret_backend_config_acme lack of max_ttl option
2 participants