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

Exposing local flag on vault_mount resource #462

Conversation

hashitop
Copy link
Contributor

@hashitop hashitop commented Jul 9, 2019

We've encountered an issue where the -local flag is supported by Vault API as well as CLI according to this document below

https://learn.hashicorp.com/vault/operations/mount-filter#cli-command-3

Current version of terraform-provider-vault does not support this attribute

https://www.terraform.io/docs/providers/vault/r/mount.html

Argument Reference

The following arguments are supported:

  • path - (Required) Where the secret backend will be mounted

  • type - (Required) Type of the backend, such as "aws"

  • description - (Optional) Human-friendly description of the mount

  • default_lease_ttl_seconds - (Optional) Default lease duration for tokens and secrets in seconds

  • max_lease_ttl_seconds - (Optional) Maximum possible lease duration for tokens and secrets in seconds

  • options - (Optional) Specifies mount type specific options that are passed to the backend

I have examined the source code in Vault API and found that the data structure MountInput has already accommodated this flag hence API is working, only the provider is not currently exposing the flag at the vault_mount resource.

The file resource_mount.go is modified to allow flag local as boolean type as optional for cluster environment, in case local mount is required, to pass through to API via MountInput data structure. Please review and share comment if any concern.

Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

Hi @hashitop ! Thanks for submitting this! Looks great!

Would you be willing to add one separate test where this is set to true? Just to make sure everything works as expected.

@ghost ghost added size/M and removed size/XS labels Aug 3, 2019
@hashitop
Copy link
Contributor Author

hashitop commented Aug 3, 2019

Hi @tyrannosaurus-becks
another test case added, trying to keep the same pattern, and it's been unit test locally as well but I think circleci failed because of some other test.

@tyrannosaurus-becks
Copy link
Contributor

Thanks for adding the test! I double-checked the test by merging in master and pushing it up, and I found that the build does succeed with master merged in, so we should be safe.

@tyrannosaurus-becks tyrannosaurus-becks merged commit e867cd8 into hashicorp:master Aug 5, 2019
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
…-vault_mount

Exposing local flag on vault_mount resource
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.

2 participants