[ - - - - - - - - - - - - 更新 - - - - - - - - - - - - - -]
我已经尝试了一个教程,现在将 terraform 与 s3 集成。 S3 存储桶已创建,我已经创建了一个 IAM 用户,我正在使用它的访问 key 和 secret key 。
尽管如此,我在 terraform init
之后不断收到有关提供商的错误消息:
后端.tf
terraform {
required_version = ">=0.12.0"
backend "s3" {
region = "us-east-1"
key = "terraform.tfstate"
profile = "tu"
bucket = "terraformstatebucket3107"
}
}
.aws 文件夹中的配置文件 [tu]
region = us-east-1
output = json
.aws 文件夹中的凭据文件 [tu]
aws_access_key_id = AKIA*****************
aws_secret_access_key = nn3M1*****************
错误:Initializing the backend...
Error: error configuring S3 Backend: no valid credential sources for S3 Backend found.
Please see https://www.terraform.io/docs/backends/types/s3.html
for more information about providing credentials.
Error: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
最佳答案
跑 terraform init
您必须添加 -backend-config
凭据选项(aws key )。
关于amazon-web-services - 配置 Terraform AWS Provider 时出错 - Linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68025133/