microsoft / azure-pipelines-terraform

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

TypeError: provider[command] is not a function #174

Closed dzmitrymezhva closed 10 months ago

dzmitrymezhva commented 10 months ago

Hello,

I get error when try to use 'custom' command:

- task: TerraformTaskV4@0
     displayName: version
     inputs:
        provider: gcp
        command: custom
        customCommand: version
##[debug]loaded 35
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]check path : /home/vsts/work/_tasks/TerraformTaskV1_fe504acc-6115-40cb-89ff-191386b5e7bf/0.203.0/task.json
##[debug]adding resource file: /home/vsts/work/_tasks/TerraformTaskV1_fe504acc-6115-40cb-89ff-191386b5e7bf/0.203.0/task.json
##[debug]system.culture=en-US
##[debug]provider=gcp
##[debug]command=custom
##[debug]task result: Failed
peError: provider[command] is not a function
ocessed: ##vso[task.issue type=error;]TypeError: provider[command] is not a function
ocessed: ##vso[task.complete result=Failed;]TypeError: provider[command] is not a function

Actually, I want to run something like:

- task: TerraformTaskV4@0
  displayName: init
  inputs:
    provider: gcp
    command: custom
    customCommand: init
    commandOptions: "-input=false -backend-config=$(branchName).gcs.tfbackend"
    backendServiceGCP: "gcp-$(branchName)"
    workingDirectory: "terraform/"

Maybe it's not possible but anyway 'custom' command shoudn't fail with TypeError.

mericstam commented 10 months ago

hi. try with TerraformTaskV4@4

br Manuel

dzmitrymezhva commented 10 months ago

@mericstam huge thanks for help!