hashicorp / terraform-cdk

Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform
https://www.terraform.io/cdktf
Mozilla Public License 2.0
4.87k stars 455 forks source link

Improve list token access error message #2548

Open DanielMSchmidt opened 1 year ago

DanielMSchmidt commented 1 year ago

Community Note

Description

Found an encoded list token string in a scalar string context. Use 'Fn.element(list, 0)' (not 'list[0]') to extract elements from token lists does not seem to help people. Maybe we should link to a documentation article to clarify

References

ansgarm commented 1 year ago

I'd propose to close this as a duplicate of #2254 – what do you think, @DanielMSchmidt?

DanielMSchmidt commented 1 year ago

I don't think they cover quite the same topic although it's about the same error message. This issue proposes rephrasing the error message as well as linking to a documentation page that helps, the one you linked talks about hinting towards iterators. We can combine them, but I don't think they are the same