gpt4 book ai didi

terraform - BucketRegionError : incorrect region, 存储桶不在 'eu-west-2' 中 - terraform

转载 作者:行者123 更新时间:2023-12-03 06:54:43 25 4
gpt4 key购买 nike

我需要 terraform 来访问我的 S3 存储桶,但它无法在指定区域找到该存储桶。

我的main.tf:

provider "aws" {
region = "eu-west-2"
}

terraform {
backend "s3" {
bucket = "xyz-state-blog"
key = "dev/terraform"
region = "eu-west-2"
}
}

locals {
azs = ["eu-west-2a", "eu-west-2b", "eu-west-2c"]
environment = "dev"
kops_state_bucket_name = "${local.environment}-kops-state"
// Needs to be a FQDN
kubernetes_cluster_name = "k8s-dev0.domain.com"
ingress_ips = ["10.0.0.100/32", "10.0.0.101/32"]
vpc_name = "${local.environment}-vpc"

tags = {
environment = "${local.environment}"
terraform = true
}
}

data "aws_region" "current" {}

以下是我在 terraform init 命令上遇到的错误:

Error inspecting states in the "s3" backend:
BucketRegionError: incorrect region, the bucket is not in 'eu-west-2' region
status code: 301, request id: , host id:

最佳答案

对我来说,删除.terraform文件夹并尝试terraform init再次为我解决了与区域相关的问题。

关于terraform - BucketRegionError : incorrect region, 存储桶不在 'eu-west-2' 中 - terraform,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55337454/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com