Skip to content

Conversation

mericstam
Copy link
Collaborator

This pull request updates the Terraform task handlers in both version 4 and version 5 to ensure the -input=false flag is consistently added to all Terraform commands (init, plan, apply, and destroy) if it is not already present in the commandOptions. This change improves automation by disabling interactive prompts during Terraform execution.

Updates to Terraform Task Handlers

Changes in Version 4 (TerraformTaskV4):

  • init Command: Added logic to append -input=false to commandOptions if not already present. ([Tasks/TerraformTask/TerraformTaskV4/src/base-terraform-command-handler.tsR77-R84](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-f68cda4f8181153bf1003884dfec243ab7aedf1a5d0ee95edc94a3952ea06b37R77-R84))
  • plan Command: Ensured -input=false is appended to commandOptions alongside -detailed-exitcode. ([Tasks/TerraformTask/TerraformTaskV4/src/base-terraform-command-handler.tsL156-R163](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-f68cda4f8181153bf1003884dfec243ab7aedf1a5d0ee95edc94a3952ea06b37L156-R163))
  • apply Command: Appended -input=false to additionalArgs if missing, ensuring non-interactive execution. ([Tasks/TerraformTask/TerraformTaskV4/src/base-terraform-command-handler.tsL214-R226](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-f68cda4f8181153bf1003884dfec243ab7aedf1a5d0ee95edc94a3952ea06b37L214-R226))
  • destroy Command: Added -input=false to additionalArgs if not already included. ([Tasks/TerraformTask/TerraformTaskV4/src/base-terraform-command-handler.tsL236-R252](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-f68cda4f8181153bf1003884dfec243ab7aedf1a5d0ee95edc94a3952ea06b37L236-R252))

Changes in Version 5 (TerraformTaskV5):

  • init Command: Same logic as in version 4 to add -input=false to commandOptions. ([Tasks/TerraformTask/TerraformTaskV5/src/base-terraform-command-handler.tsR77-R84](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-1a3717e44dc2d4fb00c77cba4c316848cd4c64b0f043e079b120a96ec8c24839R77-R84))
  • plan Command: Ensured -input=false is appended to commandOptions alongside -detailed-exitcode. ([Tasks/TerraformTask/TerraformTaskV5/src/base-terraform-command-handler.tsL156-R163](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-1a3717e44dc2d4fb00c77cba4c316848cd4c64b0f043e079b120a96ec8c24839L156-R163))
  • apply Command: Appended -input=false to additionalArgs if missing, similar to version 4. ([Tasks/TerraformTask/TerraformTaskV5/src/base-terraform-command-handler.tsL214-R226](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-1a3717e44dc2d4fb00c77cba4c316848cd4c64b0f043e079b120a96ec8c24839L214-R226))
  • destroy Command: Added -input=false to additionalArgs if not already included. ([Tasks/TerraformTask/TerraformTaskV5/src/base-terraform-command-handler.tsL236-R252](https://github.com/microsoft/azure-pipelines-terraform/pull/303/files#diff-1a3717e44dc2d4fb00c77cba4c316848cd4c64b0f043e079b120a96ec8c24839L236-R252))

@mericstam mericstam linked an issue Jun 4, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include -input=false for all commands that support it
1 participant