【问题标题】:Block usages for a terraform 0.11 module to be terraform 0.12 compatible阻止 terraform 0.11 模块的使用与 terraform 0.12 兼容
【发布时间】:2019-11-24 09:59:33
【问题描述】:

在迁移到 0.12 之前,我正在将我的 terraform 模块转换为与 0.12 兼容。除了可以通过变量设置的一些块之外,我能够修复所有转换。该模块将保留一段时间 0.11,但该模块的用户已经可以升级到 0.12。

在这里查看我的 terraform 0.11 片段。

data "aws_ami" "instance" {
  most_recent = true

  filter = "${var.runner_ami_filter}"

  owners = "${var.runner_ami_owners}"
}


variable "ami_filter" {
  type        = "list"

  default = [{
    name   = "name"
    values = ["amzn-ami-hvm-2018.03*-x86_64-ebs"]
  }]
}

问题是我无法转换变量ami_filter 这样它将被 0.12 接受。我抱怨过滤器的块定义。

此处不应使用名为“filter”的参数。你的意思是定义一个 “过滤器”类型的块?

有没有人建议如何将这部分代码转换为 0.12 兼容?

【问题讨论】:

标签: terraform


【解决方案1】:

我使用的构造似乎是一个未记录的功能,不再受支持。

本期更多详情:https://github.com/hashicorp/terraform/issues/20505#issuecomment-496601736

【讨论】:

    猜你喜欢
    • 2019-11-28
    • 1970-01-01
    • 1970-01-01
    • 2020-06-30
    • 2021-08-22
    • 2020-12-28
    • 2020-01-10
    • 2023-04-06
    • 2020-03-10
    相关资源
    最近更新 更多