【发布时间】:2021-09-03 23:49:01
【问题描述】:
上下文:
- 我已使用 aws configure 设置了我的 aws 凭据。
- 我使用 terraform 远程后端来存储 terraform 状态
使用以下 terraform 配置。
terraform {
backend "remote" {
hostname = "app.terraform.io"
organization = "test"
workspaces {
prefix = "networking-"
}
}
}
provider "aws" {
region = "eu-west-3"
}
问题: 当我运行 terraform apply 时出现此错误。
╷
│ Error: No valid credential sources found for AWS Provider.
│ Please see https://terraform.io/docs/providers/aws/index.html for more information on
│ providing credentials for the AWS Provider
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on main.tf line 13, in provider "aws":
│ 13: provider "aws" {
│
╵
【问题讨论】:
-
要么确保您设置了环境变量 AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY、AWS_DEFAULT_REGION 或者使用凭证文件
标签: amazon-web-services terraform terraform-provider-aws