【发布时间】:2020-02-17 18:16:08
【问题描述】:
我正在尝试使用 Terraform 和 Azure Devops 创建 Azure 虚拟机。我遇到了错误。
“目录 /home/vsts/work/1/s 不包含 Terraform 配置文件。”
下面是我的 .yml 文件。
resources:
- repo: self
steps:
- task: TerraformInstaller@0
inputs:
terraformVersion: '0.12.3'
- task: TerraformTaskV1@0
displayName: 'Init terraform'
inputs:
provider: 'azurerm'
command: 'init'
backendServiceArm: 'Free Trial'
backendAzureRmResourceGroupName: 'terraformtest-rg'
backendAzureRmStorageAccountName: 'terraformtestrgdiag'
backendAzureRmContainerName: 'bootdiagnostics-terraform'
backendAzureRmKey: 'terraform'
- task: TerraformTaskV1@0
displayName: 'apply status'
inputs:
terraformFile: './terraform/terra/main2.tf'
provider: 'azurerm'
command: 'apply'
environmentServiceNameAzureRM: 'Free Trial ()'
【问题讨论】:
-
我怀疑您需要在第一个 tf 步骤中添加
terraformFile: './terraform/terra/main2.tf'?
标签: azure-devops terraform-provider-azure