Closed mpaluchowski closed 4 years ago
I don't think it's either though we could likely make it clearer in the doc. I believe that returns a list and so the 0 is normal for specifying a value in the list. I've seen similar in other terraform outputs. @PacoDw or @coderGo93 can you confirm and if so I'll include a clarification in the docs for next release (and if not can you provide guidance)
Why would that return a list if there's only one element? Would it be possible to return a map instead and just access the keys without the extra 0
index?
@mpaluchowski, the reason what we have to use this attribute as a list is due to some Terraform limitations, we cannot have a map (k/v) with non-primitive types (int, bool, string) and, since we have two non-primitive attributes (aws_private_link and aws_private_link_srv) the generic workaround is to use a list with max value = 1.
Thanks for the explanation.
Could you update the documentation to show this clearly?
Absolutely. I'll knock out a PR to improve it. Thank you @mpaluchowski
The documentation for accessing
connection_strings
formongodbatlas_cluster
resources says I should be able to do this:but this returns an error:
and it works only when I do this:
Is this a bug in the code? Or in documentation? I'm suspecting the former, because accessing the property via a
0
index looks odd.