我在Azure DevOps中有我的编码项目,我想使用我创建的Terraform模块。然而,我想保持地形和我的应用程序在不同的项目。
当我想在AZ管道中使用Terraform时遇到问题,运行管道时会收到以下错误:
- task: Bash@3
displayName: 'DEBUG'
inputs:
targetType: 'inline'
script: |
git config --get-all --global http.https://dev.azure.com/my-organization/Infra/_git/terraform-modules.extraheader "Authorization: bearer $SYSTEM_ACCESSTOKEN"
terraform init
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)输出
Error: Failed to download module
Could not download module "iam" (aws_ecs.tf:11) source code from
"git::https://dev.azure.com/my-organization/Infra/_git/terraform-modules": error
downloading 'https://dev.azure.com/my-organization/Infra/_git/terraform-modules':
/usr/bin/git exited with 128: Cloning into '.terraform/modules/iam'...
fatal: could not read Username for 'https://dev.azure.com': terminal prompts
disabled模块源配置如下:
source = "git::https://dev.azure.com/my-organization/Infra/_git/terraform-modules//modules/ecs-iam"AZ DevOps设置(图像):
在本地机器上,一切正常工作,模块被克隆。
我试着遵循官方指南https://www.terraform.io/docs/modules/sources.html
这有可能吗?
发布于 2020-11-08 17:21:25
我认为您在git配置中有错误的url,应该删除存储库名称之后的所有内容。
看起来应该是:
git config --global http.https://dev.azure.com/my-organization/Infra.extraheader "Authorization: bearer $SYSTEM_ACCESSTOKEN"发布于 2020-11-08 17:32:45
没有必要直接使用Git。将repository资源添加到YAML中,然后使用checkout克隆它。
https://stackoverflow.com/questions/64739373
复制相似问题