Skip to content

Option to specify mount point in provider block #1

@arturtamborski

Description

@arturtamborski

Hi! Thank you for forking this repo and adding the macOS support, it's really helpful!

Would you be interested to accept a patch implementing a way of specifying a mount point?

Here's an example of my idea:

terraform {
  required_providers {
    pass = {
      source = "mecodia/pass"
    }
  }
}
# [...]
+provider "pass" {
+  mount = "work-secrets"
+}

this, in turn, would allow the user to only specify the key in said mountpoint:

data "pass_password" "my_github_password" {
-  path = "work-secrets/github/password"
+  path = "github/password"
}

which in my opinion would come in handy when you use a lot of secrets:

  • allows you to shorten the repetitive path a bit over multiple resources/data sources
  • helps in avoiding a misconfiguration in situations where the same path is present in both root and custom mounts.

From technical perspective I was thinking on implementing it like so:

  • adding a variable to the passProvider state struct
  • checking if specified mount point is present at the provider initialization
  • prefixing every path with the passProvider.mount in resources and data sources

Let me know what do you think about it :) cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions