【发布时间】:2020-02-05 10:09:10
【问题描述】:
我的可用资源是
操作系统 - ubuntu 18.04 | Terraform cli - Terraform v0.12.9 |用户 - root 登录
我的问题是 - 我希望 tfstate 通过 s3 远程存储后端,所以我手动创建了一个
s3 存储桶 - selllist-infra
为此我创建了 backend.tf
文件和我的 terraform 脚本在下面,当我 terraform init 下面的错误时。
脚本有什么问题?
provider "aws" {
acces_key = "**************"
secret_key = "**************"
}
terraform {
backend "s3" {
bucket = "sellist-infra"
key = "terraform/sellist/do/prod/terraform.tfstate
endpoint = "nyc3.digitaloceanspaces.com"
region = "us-east-1"
profile = "sellist-do"
skip_credentials_validation = true
skip_get_ec2_platforms = true
skip_requesting_account_id = true
skip_metadata_api_check = true
}
}
***OUTPUT***
Initializing the backend...
Warning: "skip_requesting_account_id": [DEPRECATED] The S3 Backend no longer automatically looks up the AWS Account ID and this attribute is no longer used.
Warning: "skip_get_ec2_platforms": [DEPRECATED] The S3 Backend does not require EC2 functionality and this attribute is no longer used.
Error: Failed to get existing workspaces: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
【问题讨论】:
-
在我看来,将凭据存储在文件本身中并不是一个好主意。我将它们存储在未提交或上传的 tfvars 文件中。
标签: amazon-web-services amazon-s3 terraform terraform-provider-aws minio