amazon-web-services - 配置 Terraform AWS Provider 时出错 - Linux

标签 amazon-web-services docker amazon-s3 terraform terraform-provider-aws

[ - - - - - - - - - - - - 更新 - - - - - - - - - - - - - -]
我已经尝试了一个教程,现在将 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/

相关文章:

ios - 如何在 swift 中使用 filterExpression 执行 DynamoDB 扫描

go - 如何创建 docker 镜像然后将其上传到我的存储库?

docker - (GitHub Actions,上传工件)尽管授予文件完全权限,但尝试上传文件时访问被拒绝

javascript - AWS Lambda 函数和 S3 - 仅当对象发生更改时才更改 S3 中对象的元数据

amazon-web-services - 如何使用AWS Lambda检查S3中的文件

amazon-web-services - 我想知道如何通过修改此 lambda 代码将数据导入应用程序

amazon-web-services - AWS SAM : The REST API doesn't contain any methods

amazon-web-services - 如何使用 CLI 为 Elastic Beanstalk 配置 VPC

amazon-web-services - 由于命名约定,使用 DynamoDB AWS SDK [No Mapping for Hash Key] 时出错

docker - 如果 docker 重新启动,为什么我会丢失数据?