我的文件夹结构如下:
'state_initialization'文件夹内的main.tf如下:
module "state_initialisation_tagging" {
source = "../"
standard_tags = data.terraform_remote_state.param_store_tags.outputs.standard_tags
.. others...
}
同一文件夹中的 data.tf 具有以 s3 作为后端定义的数据资源。
但是当我在模块级别进行地形规划时,我收到以下错误消息。我缺少什么?我假设我不需要输出变量,因为模块 main.tf 中的 standard_tags = data.remote_state.xxx 正在处理这个问题。
The root module input variable "standard_tags" is not set, and has no default value. Use a -var or
│ -var-file command line argument to provide a value for this variable.
我在根模块和子模块中都有“standard_tags”的变量定义。在我注释掉子模块中的那个之后它就起作用了。我们模板中的模块资源定义位于子模块中,因此有点混乱。将其更改为标准符号。