【问题标题】:terraform sub-module changes not being recognized in plan or applyterraform 子模块更改未在计划中识别或应用
【发布时间】:2018-02-06 04:52:26
【问题描述】:

我有一个 terraform repo,看起来像这样:

  • 基础设施
    • 全球
      • main.tf

main.tf 文件引用远程存储库中的模块:

module "global" {
    source = "git@github.com/company/repo//domain/global"
}

上面的模块引用了同一个远程仓库中的另一个模块:main.tf

module "global" {
        source = "git@github.com/company/repo//infrastructure/global"
    }

如果我在此模块中进行 3 级深度的更改,然后在顶级 Terraform 项目中运行 terraform getterraform init,然后运行 ​​terraform plan,则不会执行这些更改。

这有什么原因吗?

【问题讨论】:

    标签: terraform


    【解决方案1】:

    我需要执行以下操作之一:

    1) 在运行terraform init 时,我需要传递标志upgrade=true

    2) 或者如果运行terraform get,我需要传递标志update=true

    这会下载所请求模块的最新版本

    【讨论】:

      猜你喜欢
      • 2020-05-06
      • 2020-07-24
      • 1970-01-01
      • 2021-08-30
      • 2019-04-29
      • 2021-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多