【发布时间】:2021-10-25 01:24:49
【问题描述】:
这是我的资源 tf 架构:
Schema: map[string]*schema.Schema{
"config_sensitive": {
Type: schema.TypeMap,
Optional: true,
ForceNew: false,
Sensitive: true,
Description: "Sensitive part of connector configuration. String keys and values",
},
当我尝试编译它时,我遇到了:
resource ...:未定义更新,必须将 ForceNew 设置为:
[]string{"config_sensitive"}。
有没有办法在不设置ForceNew: true 的情况下摆脱这个错误(我不知道Update 到底是什么)?
【问题讨论】:
-
错误信息表明您必须为资源定义一个更新函数,否则您必须将
ForceNew指定为true,因为这将强制使用关联函数执行删除/创建操作。您选择两者中的哪一个取决于 API 功能,但资源必须具有定义的更新或删除/创建功能。 -
我明白了,您能否将其发布为评论,以便我批准您的回答?
-
转换为答案。