【发布时间】:2019-05-26 14:59:02
【问题描述】:
从本地源调用模块时一切正常,但是我决定重构 Terraform 代码以使用 git 存储库来存储模块。
我在我们的 BitBucket 帐户中创建了一个名为 terraform-modules 的新存储库,并将模块的源属性重构为具有以下结构:
source = "git::ssh://git@bitbucket.org:carepaydev/terraform-modules.git//modules/iam/iam_roles/assumable_role"
调用terraform init 时出现以下错误:
Error downloading modules: Error loading modules: error downloading 'ssh://git@bitbucket.org:<username>/terraform-modules.git': /usr/local/bin/git exited with 128: Cloning into '.terraform/modules/caf541f5e5ccbb1d204bce3b94091014'...
ssh: Could not resolve hostname bitbucket.org:<username>: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
使用 git clone 克隆存储库确实有效。我尝试将TF_LOG env var 设置为TRACE,看看这是否会给我更多的洞察力,但这并没有帮助。
任何线索为什么会失败?
【问题讨论】: