hashicorp / terraform-k8s

Terraform Cloud Operator for Kubernetes
https://learn.hashicorp.com/tutorials/terraform/kubernetes-operator?in=terraform/kubernetes
Mozilla Public License 2.0
455 stars 71 forks source link

Optional module directory for git modules #138

Open eakman-nomad opened 2 years ago

eakman-nomad commented 2 years ago

Community Note

Description

When using a git repository as a source for a Workspace, I would like to be able to point to a subdirectory where the module lives. e.g.:

apiVersion: app.terraform.io/v1alpha1
kind: Workspace
metadata:
  name: pubsub
spec:
  sshKeyID: sshkey-frVpWGjJBNof8Kth
  organization: MyOrg
  secretsMountPath: "/tmp/secrets"
  module:
    source: "git@github.com:MyOrg/my-repo.git"
    sourceDir: "pubsub/" # <-- THIS

This way, I can house multiple modules within a single source code repository. If there's another way to accomplish this, I would be thrilled to know.

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References