在 terraform(aws 提供商)中创建接口类型 vpc 端点时出错

Error while creating interface type vpc endpoint in terraform (aws provider)

我正在尝试在 aws 上的 terraform 中创建接口类型 kms 端点。这样做时,出现以下错误 -

创建 VPC 端点时出错:无效参数:子网:子网- 在服务中没有相应的区域 com.amazonaws.ap-东南-1.kms

我的端点资源看起来像 --

    resource "aws_vpc_endpoint" "kms" {
  vpc_id            = "${aws_vpc.main.id}"
  service_name      = "com.amazonaws.${var.aws_region}.kms"
  vpc_endpoint_type = "Interface"

  subnet_ids = [
<my subnet ids>
  ]

  security_group_ids = [ <my sg ids> ]
  private_dns_enabled = true
} 

任何人对我可能遗漏的任何线索。仅供参考——我还没有为 kms 添加任何 route53 记录。我需要吗?

期待任何答复。

谢谢 阿维

如果您没有在 Route53 中创建私有 DNS,请设置 private_dns_enabled=false 。否则先创建私有区域。

我通过为不同的子网创建多个端点资源解决了这个问题。