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

Terraform map outputs break garden #1947

Closed
ThisGuyCodes opened this issue Jul 15, 2020 · 4 comments · Fixed by #1974
Closed

Terraform map outputs break garden #1947

ThisGuyCodes opened this issue Jul 15, 2020 · 4 comments · Fixed by #1974

Comments

@ThisGuyCodes
Copy link
Contributor

Bug

Current Behavior

Failed getting status for service 'xyz' (from module 'xyz'). Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Error validating getServiceStatus terraform output from provider terraform: key .outputs[terraform_outputs] must be one of [number, string, boolean]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 test task(s) failed!

Expected behavior

Works.

Reproducible example

Any terraform output that has a map:

output "a_map" {
  value = map(
      "first", "first_value",
      "second", "second_value"
  )
}

Workaround

Don't use map outputs.

Suggested solution(s)

Output validator should consider more types valid.

Additional context

Personally it's less important that I be able to access this value in templating (though I believe you're using the json output, so idk how hard that'd be). I'm already dumping the output to a json in an exec build.

@ThisGuyCodes
Copy link
Contributor Author

Can this get some attention? Even just validation that I'm not doing something wrong.

This will become more problematic for us as we want our infrastructure to be more modular (specific example: every RDS instance gets a debezium kafka connect instance, which is easy if our RDS instances are a map we can loop over).

@edvald
Copy link
Collaborator

edvald commented Aug 3, 2020

My apologies @ThisGuyCodes. Much of the team has been away, I'm catching up a little. Hadn't seen this before. We rely on terraform to output JSON, and don't make any attempt to parse the HCL. Need to see what the terraform CLI is actually outputting in this scenario, to see if it's something we can address.

@edvald
Copy link
Collaborator

edvald commented Aug 3, 2020

Oh I see it now. It's a no-longer-needed limitation in the outputs schema. I can simply lift that, now that we properly support maps/arrays/etc for our templating.

@ThisGuyCodes
Copy link
Contributor Author

@edvald you just made my day!

edvald added a commit that referenced this issue Aug 3, 2020
edvald added a commit that referenced this issue Aug 5, 2020
eysi09 pushed a commit that referenced this issue Aug 5, 2020
eysi09 pushed a commit that referenced this issue Aug 5, 2020
eysi09 pushed a commit that referenced this issue Aug 5, 2020
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