gpt4 book ai didi

terraform - 如何修复 provider.vault : no vault token found?

转载 作者:行者123 更新时间:2023-12-04 08:08:00 28 4
gpt4 key购买 nike

这是official docs关于保管库提供商,事情是:

provider "vault" {
version = "2.10.0"
address = "..."
}
我确实设置了 VAULT_ADDRVAULT_TOKEN :
terraform plan -lock=false dev/foo_dev
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.aws_iam_policy_document.foo_doc: Refreshing state...

------------------------------------------------------------------------

Error: Error running plan: 1 error occurred:
* provider.vault: no vault token found
make: *** [plan] Error 1
✗ echo $VAULT_ADDR
...
✗ echo $VAULT_TOKEN
...

token - (Required) Vault token that will be used by Terraform to authenticate. May be set via the VAULT_TOKEN environment variable.


如果我删除 address = "..."我可以看到相同的错误,因此无法检索 VAULT_ADDR任何一个。

最佳答案

你导出变量了吗?你需要使用

export VAULT_TOKEN=s.123456789abc
export VAULT_ADDR=vault.company.org
不只是
VAULT_TOKEN=s.123456789abc
VAULT_ADDR=vault.company.org
否则 terraform 将看不到这些变量。

关于terraform - 如何修复 provider.vault : no vault token found?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66126214/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com