microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
101 stars 62 forks source link

Custom command is wrapped in quotation marks and not a recognisable terraform command #125

Closed codeprang closed 1 year ago

codeprang commented 1 year ago

I'm trying to use the custom command to import a resource. If I enter a command such as: import aws_instance.example i-abcd1234 into the Custom Command box in the task on the pipeline, it gets wrapped in quotation marks and the task fails as it isn't recognised as a valid terraform command. This can be seen in the logs as:

_tool\terraform\1.3.7\x64\terraform.exe "import aws_instance.example i-abcd1234"

Some better documentation on how to use the custom command would also be helpful.

mericstam commented 1 year ago

Hi, Are you using classic pipeline or YAML pipeline? In the custom field you should only put the command in your case: import . in the commandOptions field you should put your options, in your case: aws_instance.example i-abcd1234

codeprang commented 1 year ago

Thanks, that's fixed it now. I'm using the classic pipeline.