【发布时间】:2020-02-12 01:16:47
【问题描述】:
我正在重构一些 Terraform 模块并得到:
Error: Provider configuration not present
To work with
module.my_module.some_resource.resource_name its
original provider configuration at
module.my_module.provider.some_provider.provider_name is required, but it
has been removed. This occurs when a provider configuration is removed while
objects created by that provider still exist in the state. Re-add the provider
configuration to destroy
module.my_module.some_resource.resource_name, after
which you can remove the provider configuration again.
看来我需要从 tfstate 文件中删除该资源,然后使用新的 tf 配置重新添加它。
当我重构一些单体代码时,有数百条 Error: Provider configuration not present 消息。
有删除和重新添加的快捷方式吗?
【问题讨论】:
-
如果你不需要处理资源的存在你可以直接修改状态:
terraform state rm module.my_module.some_resource.resource_name
标签: terraform terraform-modules