deliveredtechnologies / terraform-maven

Terraform Maven Plugin
Apache License 2.0
42 stars 13 forks source link

tfvars with string list arguments breaks on wrong quotes #264

Open flashpixx opened 2 years ago

flashpixx commented 2 years ago

Describe the bug Define the tfvars section with an argument which contains a list of strings

To Reproduce

  1. define tfvar section with
    <tfvars>
    mylist=["first string", "second string"]
    <tfvars>
  2. run tf:plan

The command which is executed contains the section -var="mylist=["first string", "second string"]"

Expected behavior

Based on the Terraform documentation it should use single quotes on lists, so the correct command should -var='mylist=["first string", "second string"]'

Additional context

Solution idea is to extend the tfvars section with additional child tags for single, list and object value:

<tfvars>

<singlevar>
<name>singlevalue</name>
<value>single value</value>
</singlevar>

<complexvar>
<name>listvalue</name>
<value>["my first element", "my second element"]</value>
</complexvar>

<complexvar>
<name>objectvalue</name>
<value>{"key": 123}</value>
</complexvar>

<tfvars>