hashicorp / terraform-provider-vault

Terraform Vault provider
https://www.terraform.io/docs/providers/vault/
Mozilla Public License 2.0
451 stars 535 forks source link

[Enhancement]: Allow setting num_uses and ttl for vault_approle_auth_backend_role_secret_id #2236

Open nwallace83 opened 2 months ago

nwallace83 commented 2 months ago

Description

Generating an AppRole secret_id in the vault API allows specifying the num_uses and ttl as long as they are lower then the default value of the role. Per the documentation for the vault_approle_auth_backend_role_secret_id resource, these parameters can't currently be set when generating a secret_id in Terraform.

Affected Resource(s) and/or Data Source(s)

vault_approle_auth_backend_role_secret_id

Potential Terraform Configuration

resource "vault_approle_auth_backend_role_secret_id" "id" {
  backend   = vault_auth_backend.approle.path
  role_name = vault_approle_auth_backend_role.example.role_name

  ttl       = 3600
  num_users = 100
}

References

https://developer.hashicorp.com/vault/api-docs/auth/approle#generate-new-secret-id https://registry.terraform.io/providers/hashicorp/vault/latest/docs/resources/approle_auth_backend_role_secret_id

Would you like to implement a fix?

None