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

provider/vault: vault_mount resource #14456

Merged
merged 2 commits into from
Jun 2, 2017

Conversation

wjam
Copy link
Contributor

@wjam wjam commented May 12, 2017

Part of #12167

Note that remounting hasn't been implemented because the path is being used as the ID. The attributes force_no_cache & local are not able to be set as the Vault API doesn't expose these values.

Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

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

Looks good to me, @wjam. Thanks!

I left a comment inline for your information; I'm going to hold off on merging this for the moment in case you'd like to do another pass to support remounts, but if you'd rather leave this here and have that added in a separate PR that's fine by me.

path := d.Id()

log.Printf("[DEBUG] Updating mount %s in Vault", path)

Copy link
Contributor

Choose a reason for hiding this comment

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

It is actually valid to call d.SetId from inside the update function, so in principle it should be fine to support remount here and just be careful do call d.SetId if and only if the remount succeeds.

This seems desirable to allow moving a mount without losing its internal state, though if you'd rather save that for a followup PR I think that's fine.

@wjam
Copy link
Contributor Author

wjam commented May 13, 2017

Okay, thanks for that @apparentlymart. I've just pushed the changes to add support for remounting mounts.

The extra attributes are still missing due to the Vault API issue.

@wjam
Copy link
Contributor Author

wjam commented May 18, 2017

Hi @apparentlymart. Is this okay to be merged? I'm keen to get this into the next release...

@wjam
Copy link
Contributor Author

wjam commented May 18, 2017

Just realised that mounts can be created through the vault_generic_secret. Is this intended or should the documentation of it be improved to show how to accomplish other tasks in Vault?

@wjam
Copy link
Contributor Author

wjam commented May 18, 2017

Just realised that using vault_generic_secret means that there's no way to perform remounting so this PR is needed

@bmoylan
Copy link

bmoylan commented Jun 2, 2017

ping! Can this merge before the next release?

@@ -90,6 +90,7 @@ func Provider() terraform.ResourceProvider {
"vault_auth_backend": authBackendResource(),
"vault_generic_secret": genericSecretResource(),
"vault_policy": policyResource(),
"vault_mount": mountResource(),
Copy link

@bmoylan bmoylan Jun 2, 2017

Choose a reason for hiding this comment

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

There is an existing vault_auth_backend; maybe vault_secret_backend is more consistent with the lingo. A vault_audit_backend would be nice too.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good thought, @bmoylan! I think though that since the term "mount" is what appears in Vault's UI it makes sense to follow that here so that it's easier to understand how the Terraform resources map onto the Vault CLI operations.

@apparentlymart apparentlymart merged commit 971eabb into hashicorp:master Jun 2, 2017
@apparentlymart
Copy link
Contributor

Thanks for this, @wjam, and sorry for the delay in getting it merged.

@wjam wjam deleted the vault_mounts branch June 3, 2017 20:50
@ghost
Copy link

ghost commented Apr 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants