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

Override output name / namespace #110

Open
ejhayes opened this issue Oct 6, 2021 · 0 comments · May be fixed by #111
Open

Override output name / namespace #110

ejhayes opened this issue Oct 6, 2021 · 0 comments · May be fixed by #111
Labels
enhancement New feature or request

Comments

@ejhayes
Copy link

ejhayes commented Oct 6, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

It would be great if it were possible to change the generated outputs:

The motivation for this is that there may be cases where we want to reference terraform outputs from a different namespace (for example a service residing in namespace A may use terraform operator running in namespace B to create a database and then be able to pass the database host name to the pod via a configmap/secret reference). Since the existing functionality of this operator only creates outputs in the same namespace it is not possible to accomplish this:

You can write a Pod spec that refers to a ConfigMap and configures the container(s) in that Pod based on the data in the ConfigMap. The Pod and the ConfigMap must be in the same namespace.

Secret resources reside in a namespace. Secrets can only be referenced by Pods in that same namespace.

Potential Terraform Configuration

This functionality could be used like this:

apiVersion: app.terraform.io/v1alpha1
kind: Workspace
metadata:
  name: test-workspace
  namespace: terraform
spec:
  module:
    source: app.terraform.io/some_org/some_module/some_provider
    version: 1.0.0
  organization: some_org
  outputNamespace: my_namespace
  outputName: my_secret
  outputs:
  - key: some_output
    moduleOutputName: some_output
  secretsMountPath: /tmp/secrets
  variables:
  - key: some_key
    value: some_value
    sensitive: false
    environmentVariable: false

The above would create secret my_secret in the my_namespace namespace.

References

@ejhayes ejhayes added the enhancement New feature or request label Oct 6, 2021
@ejhayes ejhayes changed the title Override to allow output name / namespace Override output name / namespace Oct 6, 2021
@ejhayes ejhayes linked a pull request Oct 7, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant