AzBuilder / terraform-spring-boot

Spring Boot Starter for Terraform
MIT License
2 stars 6 forks source link

version 0.6.4 for terraform version 1.2.4 Error: Too many command line arguments #25

Closed kimmxu closed 1 year ago

kimmxu commented 2 years ago

The terraform client version 0.6.4 on version 1.2.4 terraform cli run error " Error: Too many command line arguments Expected at most one positional argument. For more help on using this command, run: terraform apply -help "

alfespa17 commented 2 years ago

Can you provide an example @kimmxu to reproduce the issue?

missedone commented 1 year ago

@alfespa17 I have the same issue, it turns out the position of tfplan is incorrect with my code snippet:

TerraformClient client = TerraformClient
                    .builder()
                    .environmentVariables(envVars)
                    .terraformParameters(tfVars)
                    .terraformVersion(tfVersion)
                    .jsonOutput(true)
                    .showColor(false)
                    .errorListener(System.err::println)
                    .outputListener(System.out::println)
                    .build();

image

it should be at the last image

the workaround is to disable json output and enable color:

TerraformClient client = TerraformClient
                    .builder()
                    .environmentVariables(envVars)
                    .terraformParameters(tfVars)
                    .terraformVersion(tfVersion)
                    .jsonOutput(false)
                    .showColor(true)
                    .errorListener(System.err::println)
                    .outputListener(System.out::println)
                    .build();
alfespa17 commented 1 year ago

Hello @missedone can you provide a code example so I can reproduce the issue?

missedone commented 1 year ago

@alfespa17 , just updated my comment above, let me know if you need anything else

alfespa17 commented 1 year ago

Thank you @missedone I will check code example and fix the issue in the library

alfespa17 commented 1 year ago

I have created a new version to fix the issue @missedone, you can upgrade to 0.7.1.

Feel free to open new issues if you find any other problem with the library

missedone commented 1 year ago

yes it works now, thanks for the quick fix