go - Terraform 自定义提供程序访问生命周期元数据

标签 go terraform

我正在编写一个自定义提供程序,并试图找出如何在我的 go 代码中访问 .tf 文件中的生命周期数据。

    lifecycle {
        ignore_changes = [
           "member_list"
        ]
    }

我正在研究代码,但到目前为止还没有找到它。任何帮助将不胜感激。

最佳答案

生命周期 包含 Terraform Core 在图形构建期间使用的设置。那里建模的所有行为都由 Terraform Core 本身处理,而不是由提供者处理。

因此,提供商无法访问其中的设置。在 ignore_changes 的情况下,在提供者通过丢弃 ignore_changes 列表中提到的任何参数的计划更改来生成更改计划之后应用。

关于go - Terraform 自定义提供程序访问生命周期元数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55636471/

相关文章:

azure - 根据区域在 terraform 中创建角色分配

amazon-web-services - Terraform 通过重新执行相同的 main.tf 创建多个 vpc

elasticsearch - 使用 Terraform 创建 ElasticSearch 域时出错 - 只需要一个子网

go - 需要一个示例,了解赋值运算符的Go语法如何使用通过EBNF指定的语法规则

http - golang 在 http.ListenAndServe 之后执行函数

json - Golang 解码 JSON

amazon-web-services - 寻找对 `UserConfigResponseModel` 的修改以声明正确的 `aws_api_gateway_method_response` 资源

powershell - 如何读取从 terraform 传递到 powershell userdata 脚本的 Map 类型变量的值?

go - GetLocations 失败,返回 "Object does not exist to execute method on"

go - 转到股票行情示例未选择 'done'情况?