我已经创建了一个简单的流水线。一个带有Azure DevOps 构建流水线的Github仓库。
我在Github私有仓库的ax.tf文件中定义了以下变量:
很遗憾,它没有按预期工作,并停止在下面的执行级别:
任何帮助都将不胜感激。
谢谢。
我在Github私有仓库的ax.tf文件中定义了以下变量:
ARM_CLIENT_ID
ARM_CLIENT_SECRET
ARM_SUBSCRIPTION_ID
ARM_TENANT_ID
构建流水线具有一个简单的命令行作业,如下所示:
sudo apt install wget
wget https://releases.hashicorp.com/terraform/0.11.11/terraform_0.11.11_linux_amd64.zip
sudo apt-get install unzip
unzip terraform_0.11.11_linux_amd64.zip
terraform init
terraform plan -var-file=terraform.tfvars -out=ax.plan
terraform apply ax.plan
terraform destroy -auto-approve
我希望了解如何在Terraform的ax.tf文件中引用这些构建变量?
根据Azure DevOps文档,我已经尝试了以下方式,但并没有起作用:
variable "ARM_SUBSCRIPTION_ID" {
default="$(Build.ARM_SUBSCRIPTION_ID)"
}
很遗憾,它没有按预期工作,并停止在下面的执行级别:
[0m[1m[32mTerraform has been successfully initialized![0m[32m[0m
[0m[32m
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.[0m
[0m[1mvar.ARM_CLIENT_ID[0m
任何帮助都将不胜感激。
谢谢。