[英]Handling Openstack provider credentials in Terraform without vault
是否有任何選項可用於處理 Terraform 中的 Openstack 提供商憑證,類似於 AWS 提供商中存在的憑證,如Environment variables 。
我的用例:
作為 POC 的一部分,我將從我的 python 應用程序調用terraform apply
命令,我計划在其中將 Openstack 憑據定義為環境變量,並在執行完成后取消設置。 通過這種方式,我可以避免將憑據存儲在文件中以及保管庫/領事的復雜性。
請說明,謝謝。
有幾種解決方法。 我建議從保險櫃中進行此操作。 但是,如果您真的不想這樣做,則可以使用Terraform輸入變量並在其中使用環境變量。
像這樣: terraform apply -var "osuser=${ENV_VAR}"
或專門針對Terraform中的OpenStack提供程序,您可以使用此處記錄的環境變量: https : //www.terraform.io/docs/providers/openstack/
從文檔:
auth_url-(可選;如果未指定雲,則為必需)身份驗證URL。 如果省略,則使用OS_AUTH_URL環境變量。
這些環境變量通常也在openstack GUI中也提供給您。
您還可以提示用戶這些事情,正如我在https://github.com/hashicorp/terraform/issues/13022#issuecomment-819658436中提到的:
# You can set other TF variables in here as well.
echo "Please enter the outgoing e-mail account's password: "
read -sr TF_VAR_smtp_password_unquoted
export TF_VAR_smtp_password="\"$TF_VAR_smtp_password_unquoted\""
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.