Terraform投掷错误:配置Terraform AWS提供商的错误:系统无法找到指定的路径

发布于 2025-02-12 12:58:30 字数 409 浏览 1 评论 0原文

通过CLI运行AWS命令,我面临着证书问题的问题。因此,根据某些博客,我试图使用setx aws_ca_bundle“ c:\ data \ ca-certs \ ca-bundle.pem”命令来解决问题。

现在,即使我从我的AWS配置文件中删除了变量AWS_CA_BUNDLE,Terraform仍会在Terraform上应用以下错误。

错误:配置Terraform AWS提供商的错误:加载配置:OPEN C:\ data \ ca-certs \ ca-bundle.pem:系统无法找到指定的路径。

有人可以告诉我Terraform/AWS CLI从哪里拿出这个价值以及如何删除它?我已经尝试删除整个AWS配置和凭据文件,此错误仍在丢弃,卸载AWS CLI并重新安装。

如果它在某些系统/环境变量中设置,您能告诉我如何将其重置为默认值吗?

I was facing issue with running aws command via cli with certificate issue. So as per some blogs, I was trying to fix the issue using setx AWS_CA_BUNDLE "C:\data\ca-certs\ca-bundle.pem" command.

Now even after I removed the variable AWS_CA_BUNDLE from my aws configure file, terraform keeps throwing the below error on terraform apply.

Error: error configuring Terraform AWS Provider: loading configuration: open C:\data\ca-certs\ca-bundle.pem: The system cannot find the path specified.

Can someone please tell me where terraform/aws cli is taking this value from and how to remove it? I have tried deleting the entire aws config and credential files still this error is thrown, uninstall aws cli and reinstalling.

If its set in some system/environment variable, can you please tell me how to reset it to default value?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好久不见√ 2025-02-19 12:58:30

将CA_Bundle变量添加到配置文件的语法是错误的。
您的配置文件应该看起来像这样,

[default]
region = us-east-1
ca_bundle = dev/apps/ca-certs/cabundle-2019mar05.pem

但据我了解,您想使用环境变量(aws_ca_bundle)。

aws_ca_bundle:
指定用于HTTPS证书验证的证书捆绑包的路径。
如果定义,此环境变量将覆盖配置文件设置CA_BUNDLE的值。您可以使用-CA-Bundle命令行参数覆盖此环境变量。

我建议删除环境变量(aws_ca_bundle),然后添加ca_bundle到配置文件。删除 .terraform 文件夹并运行 Terraform Init

The syntax to add ca_bundle variable to config file is wrong.
Your config file should look like this

[default]
region = us-east-1
ca_bundle = dev/apps/ca-certs/cabundle-2019mar05.pem

But as I understand you want to use environment variable (AWS_CA_BUNDLE).

AWS_CA_BUNDLE:
Specifies the path to a certificate bundle to use for HTTPS certificate validation.
If defined, this environment variable overrides the value for the profile setting ca_bundle. You can override this environment variable by using the --ca-bundle command line parameter.

I would suggest remove environment variable (AWS_CA_BUNDLE) and add ca_bundle to config file. The delete .terraform folder and run terraform init

旧城烟雨 2025-02-19 12:58:30

GO环境变量并删除由AWS_CA_BUNDLE创建的环境变量。关闭终端,然后再次开始。现在运行命令,它将正常工作。

Go environment variables and delete the environment variable created by AWS_CA_BUNDLE. Shut down Terminal and again start. Run the commands now it will work properly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文