我正在尝试将my_variable1
我在以前的作业中注册的变量传递给terraform_parameters
参数:
jobs:
- job: get_secrets
displayName: 'Get secrets from keyvault'
steps:
- template: steps/get-secrets
- task: PowerShell@2
name: publish_secrets
displayName: 'publish secrets'
inputs:
targetType: 'inline'
script: |
Write-Host "##vso[task.setvariable variable=my_variable1;issecret=true;isOutput=true;]$(my-variable1)"
- template: jobs/tf-plan
parameters:
depends_on: get_secrets
terraform_parameters: -var-file="varfile.tfvars" -var="my_variable1=$[dependencies.get_secrets['publish_secrets.my_variable1']]"
但是我得到syntax error: invalid arithmetic operator (error token is ".get_secrets['publish_secrets.my_variable1']")
在过去的几个小时里尝试了很多东西。如何将 my_variable1 作为参数传递给terraform_parameters