刚开始在AWS中使用IntelliJ,这个错误会在使用terraform命令之后弹出,代码只是EC2实例的简单部署。
Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
│
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│
│ Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request send failed, Get "http://169.254.169.2
54/latest/meta-data/iam/security-credentials/": dial tcp 169.254.169.254:80: i/o timeout
│
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on main.tf line 1, in provider "aws":
│ 1: provider "aws" {
│
╵
使用Admin组中的IAM用户,AWS Explorer的凭据是正确的。Terraform是安装了IntelliJ插件的Terraform和AWS都安装了,IntelliJ和AWS之间有连接,使用Windows 10不能在Windows上使用管理操作,我觉得Terraform和AWS不能连接(就像错误说的那样),但我不明白为什么。有什么想法吗?我如何部署这个实例?任何帮助都是非常感谢的。我是来回答你的任何问题的。我希望部署一个EC2实例。我尝试创建一个新项目,重新安装IntelliJ,使用其他IDE (如VS代码)。
发布于 2022-11-24 12:21:46
所以我不得不跑:
$ export AWS_ACCESS_KEY_ID=(your access key id)
$ export AWS_SECRET_ACCESS_KEY=(your secret access key)
我的钥匙在IntelliJ的Ubuntu终端,它工作了!
https://stackoverflow.com/questions/74547435
复制相似问题