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

Support collection objects when using outputs from another Terraform resource #465

Closed
rparmer opened this issue Nov 28, 2022 · 1 comment · Fixed by #504
Closed

Support collection objects when using outputs from another Terraform resource #465

rparmer opened this issue Nov 28, 2022 · 1 comment · Fixed by #504

Comments

@rparmer
Copy link

rparmer commented Nov 28, 2022

Using outputs from one Terraform resource as inputs to another Terraform resource works great when outputted reference is a string. However it seems to be interpreting collections (lists, maps and objects) as strings too. For example if my parent Terraform outputs a list of strings

output "testing" {
  value = ["one", "two"]
}

and the child Terraform requires a list of strings

variable "testing" {
  type = list(string)
}

the child Terraform will blow up with Invalid value for input variable ... list of string required. I can view the output and verify the secret is storing the value correctly, but the generated.auto.tfvars.json is converting the array to a string

{...,"testing":"[\"one\",\"two\"]"}

I've been able to get around this by using the terraform_remote_state data lookup. But it would be nice if the controller could support these types of output references.

@chanwit
Copy link
Collaborator

chanwit commented Dec 2, 2022

Thank you for reporting this @rparmer !!

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

Successfully merging a pull request may close this issue.

2 participants