Hey all, Wondering if anyone has seen this before. Whenever I try to pass in secrets via -var args in Terraform via GitHub actions, I get the failure "Too many command line arguments. Configuration path expected.". I know it's due to the secret because if I try passing the password in via plain text, it works just fine. Take a look at my code below and let me know if I'm being silly :)
Edmondo Porcu @edmondo1984 or maybe terraform validate? do you like writing tests in ruby, golang, or some DSL? Edmondo Porcu @edmondo1984 if that's the difference, probably in ruby I deploy env and write scripts for tests, I haven't needed those tools. If you like ruby, you might like the tool that uses it. but IDK. Edmondo Porcu @edmondo1984 However just reading Terratest documentation, it is clear that there are scenarios for which Terratest is not enough
I think it's good to do what you are doing, but you are going to spend a lot of time spinning wheels on this path I would be more clear in your path, and optimize at a reasonable pace I'm saying this having built many of these tools before they existed, or in parallel with them, or using those tools to build more awesome solutions. I see a need for the use cases described, but whether or not the tool fits is a little more nuanced of a question to answer. I would figure that out with experience. If you don't even have an example project to work with, start there. Make that deploy the way you want also, checkout the Edmondo Porcu @edmondo1984 cheers Ameya @bluemind2005_twitter I am not able to understand why terraform apply in not working on my Azure DevOps Build pipeline
Note: I have also tried terraform apply "ax.plan" -auto-approve terraform apply -auto-approve "ax.plan" does work on command line but not in Azure DevOps! Unable to understand where is the problem! Ameya @bluemind2005_twitter Output from previous task
Kindly refer to the screenshot above does that work when you run it yourself? EDIT, sorry, I see where you mention that IDK enough about azure pipelines It probably isn't an issue, but I don't see why you'd need the Ameya @bluemind2005_twitter maybe the output of the terraform plan has to be stored if you are not saving the plan as an artifact, or have some auto-caching, and you have separate "stages" here, that would be an issue (need the plan file to apply it) Ameya @bluemind2005_twitter yes you need to as -out with plan is just a plan but Terraform has explicitly added "approval" hence need to use flag -auto-approve I use
Ameya @bluemind2005_twitter Let me re-check Ameya @bluemind2005_twitter
Agreed, -auto-approve i not required but still this bugger is not working........ @bluemind2005_twitter have you tried to put the planfile reference after the params?
Ameya @bluemind2005_twitter To be very honest with you I have no idea from where Azure Pipelines/Azure DevOps/VSTS is adding "-input=false -no-color" as that is certainly not in my build task definition. I tried what you suggested me above and Azure Pipelines added "-input=false -no-color" at the end of it, I doubt that is what is causing us the grief. Please refer to the output below. I am using Terraform plugin by Peter G. I can successfully executed terraform init terraform plan and apply via shell script and it works like a charm so I don't believe this is issue with Terraform itself but with the plugin OR Azure Pipelines itself.
I think the doc is pretty clear
so I think that's why you are getting the error Ameya @bluemind2005_twitter Yep, need to figure it out from where the the redundant arguments are been added ;( Ameya @bluemind2005_twitter it's a bug in terraform I don't see the bug, except that the docs are clear, all options should be before the directory path or plan file path Ameya @bluemind2005_twitter Yep, you are right. I tested it as well and it works as long as we conform to But still not able to figure it out why terraform plaugin in Azure DevOps/pipelines is adding options at the end of the arguments. Ameya @bluemind2005_twitter Just a quick one, how to run terraform plan for a single terraform file when there are multiple files? Example: I have three terraform IaaC files and I want terraform plan on a specific file, how to do that? a.tf, b.tf and c.tf I don't want anything to be filtered on resource but filter on file Looks like I need to create separate folders for each tf file?
I think the plugin is assuming you would not use a plan file |