本文介绍了terraform 解决冲突的提供者约束:没有可用的版本与给定的约束匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在计划一次 terraform 更新.我们正在使用一个由许多模块组成的复杂 terraform 项目.

Hello I am trying to plan a terraform update. We are using a complex terraform project consisting of many modules.

我添加了一个 CloudSQL 数据库模块,它需要 hashicorp/null 版本 ~>3.1.0 但似乎我项目中的另一个模块对 hashicorp/null 版本有依赖关系〜>2.1.

I have added a CloudSQL database module which requires hashicorp/null version ~> 3.1.0 but it seems like another module from my project has a dependency constraint for hashicorp/null version ~> 2.1.

导致以下错误:

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider hashicorp/null:
no available releases match the given constraints ~> 2.1, ~> 3.1.0

如何跟踪和更新此依赖约束?我不知道我的项目的哪个部分正在执行它?

How can I track and update this dependency constraint ? I don't know which part of my project is enforcing it ?

推荐答案

terraform providersterraform version 命令有助于输出您的模块和插件/提供程序的依赖层次结构,以及它们在层次结构中的各自版本.出于调试目的,从根模块配置执行此命令将是最有用的.

The terraform providers and terraform version commands assist with outputting a dependency hierarchy of your modules and plugins/providers, and their respective versions in the hierarchy. It would be most useful to execute this command from your root module config for the purposes of your debugging.

这篇关于terraform 解决冲突的提供者约束:没有可用的版本与给定的约束匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 22:34