Terraform 策略导入错误
我有一堆现有的 Vault 策略,具有以下命名约定
- org1.bu1
- org1.bu2
- ....
- org1.buN
我想使用 terraform 管理这些策略,但是当我尝试使用 terraform 导入这些 Vault 策略时,
terraform import vault_policy.org1.bu1 org1.bu1
我得到了跟随错误
Error: Invalid address
│
│ on <import-address> line 1:
│ 1: vault_policy.org1.bu1
│
│ Resource instance key must be given in square brackets.
I have a bunch of existing Vault policies with the following naming conventions
- org1.bu1
- org1.bu2
- ....
- org1.buN
I would like to manage these policies using terraform, however when I try to import these vault policies using terraform
terraform import vault_policy.org1.bu1 org1.bu1
I get the following error
Error: Invalid address
│
│ on <import-address> line 1:
│ 1: vault_policy.org1.bu1
│
│ Resource instance key must be given in square brackets.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我拥有的、导致问题的Vault_policy 资源。
然后我将其更改为
这解决了问题并使我能够导入现有策略
Here is the vault_policy resource that I had and which caused the issue.
I then changed it to
And this fixed the issue and enabled me to import the existing policy