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

feat: add a passthrough map to configuration #338

Open
jeacott1 opened this issue Jul 22, 2024 · 5 comments
Open

feat: add a passthrough map to configuration #338

jeacott1 opened this issue Jul 22, 2024 · 5 comments

Comments

@jeacott1
Copy link

It would be helpful for downstream configuration if kubestack users could include arbitrary per environment configuration in the standard structure that was passed through to the output.

ie: given the usual

configuration = {
    apps = {
       #add a map where users can just pass through whatever they like.
       custom = {
          ENV_mycustomconfig = ""
          DISK_size = 500
       }
    }

This could be exported as its own map(map(string/any/?)) and subsequently used in arbitrary foreach blocks instead of having to duplicate the configuration/apps/ops/whatever to add custom bits and pieces.
I suggest a separate export here just because 3 levels of map usually gets awkward in tf.

thoughts?

@pst
Copy link
Member

pst commented Jul 26, 2024

I'm not quite sure what this is supposed to do or be used for. The configuration var is of type map any. Why isn't what you are trying to do working?

@jeacott1
Copy link
Author

@pst true, but the setunion won't copy nested maps.

@pst
Copy link
Member

pst commented Jul 27, 2024

I can't follow. I suggest you take a look at the code. https://github.com/kbst/terraform-kubestack/blob/master/common/configuration/outputs.tf

@jeacott1
Copy link
Author

@pst you are right, it will include the map I wanted, but any overrides in other environments will completely replace instead of amending the map. I guess thinking about it, what I am really asking for here is a special cased variable that would not be a blanket replace in ops/dev etc, where the default map values are preserved unless overridden. It would just be a nice to have option I think. It would help if tf had better support for deep merge but for now at least it doesn't.

@pst
Copy link
Member

pst commented Aug 10, 2024

Are you planning to send a PR to support merging of nested maps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants