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

utils_deep_merge_* expose the object #181

Open
sergiomcalzada opened this issue Jul 8, 2022 · 3 comments
Open

utils_deep_merge_* expose the object #181

sergiomcalzada opened this issue Jul 8, 2022 · 3 comments

Comments

@sergiomcalzada
Copy link

Describe the Feature

After mergin the files you need to convert to an object the string. If you are chaining the merge a double encode is needed

Use Case

data "utils_deep_merge_json" "example" {
  for_each  = local.some_array
  input = [for s in each.value: jsonencode(s)]
}

resource "kubectl_manifest" "example" {    
  for_each  = data.utils_deep_merge_json.example
  yaml_body =  templatefile(**jsondecode(each.value.output).template**", merge(
                  **jsondecode(each.value.output).some_object**,
                  {
                    namespace = var.ns                    
                  },
                ))
}


Describe Ideal Solution

Expose the merged string as an object

@aknysh
Copy link
Member

aknysh commented Jul 17, 2022

@sergiomcalzada thanks for mentioning this.
Unfortunately, the Terraform Plugin framework we are using does not allow outputs of complex types (only primitive).
Terraform has a newer framework which I think allows this, but we have not tested it yet.

@sergiomcalzada
Copy link
Author

Any update on this? Maybe a planned date to test?

@aknysh
Copy link
Member

aknysh commented Nov 2, 2022

@sergiomcalzada currently we don't have plans to switch to a new TF plugin framework for the provider - we have not tested it, it's relatively new, and will need time to switch the provider to use it, implement and test.
We've discussed that, but no ETA on the implementation.

We do convert the objects returned from the provider to strings as well, then in terraform we convert them back to objects.

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