【发布时间】:2017-07-25 05:59:07
【问题描述】:
Terraform 似乎无法创建 AWS 私有托管 Route53 区域,并在我尝试创建与现有 VPC 关联的新托管私有区域时出现以下错误:
Error applying plan:
1 error(s) occurred:
aws_route53_zone.analytics: InvalidVPCId: The VPC: vpc-xxxxxxx you provided is not authorized to make the association.
status code: 400, request id: b411af23-0187-11e7-82e3-df8a3528194f
这是我的 .tf 文件:
provider "aws" {
region = "${var.region}"
profile = "${var.environment}"
}
variable "vpcid" {
default = "vpc-xxxxxx"
}
variable "region" {
default = "eu-west-1"
}
variable "environment" {
default = "dev"
}
resource "aws_route53_zone" "analytics" {
vpc_id = "${var.vpcid}"
name = "data.int.example.com"
}
我不确定错误是否与以下任何一个有关:
- VPC 需要事先获得授权才能与区域关联。
- 运行 terraform 的 aws 帐户需要正确的 IAM 权限才能将区域与 vpc 关联
有人知道我该如何进一步解决这个问题吗?
【问题讨论】:
-
什么是 terraform 版本?看来您使用的是旧版本。
标签: amazon-web-services amazon-route53 amazon-vpc terraform