首页 > 解决方案 > 强制 Terraform 使用特定区域进行数据收集

问题描述

目前正在使用 AWS Organizations 在 AWS 中国开展一个项目。根据 AWS Support,Organizations 终端节点仅存在于 cn-northwest-1,但我们正在部署到 cn-north-1。

我正在尝试将数据源拉入(aws_organizations_organization)。

我设置了以下 AWS 提供商:

provider "aws" {
  version = "3.4.0"
  region  = "cn-north-1"
}

provider "aws" {
  version = "3.4.0"
  region  = "cn-northwest-1"
  alias   = "northwest"
}

我正在像这样提取数据:

data "aws_organizations_organization" "org" {
    provider      = aws.northwest
}

Error: error listing AWS Service Access for Organization (redacted): UnsupportedAPIEndpointException: This API endpoint is not supported in this region
有任何想法吗?我的顶级OU parent_id 有点需要这个

resource "aws_organizations_organizational_unit" "core" {
  name      = "core"
  parent_id = data.aws_organizations_organization.org.roots.0.id
}

标签: terraformterraform-provider-aws

解决方案


推荐阅读