【发布时间】:2017-03-19 21:58:03
【问题描述】:
我正在尝试在账户之间创建一个 VPC 对等点并自动接受它,但它失败并出现权限错误。
这里是 main.tf
中的 providersprovider "aws" {
region = "${var.region}"
shared_credentials_file = "/Users/<username>/.aws/credentials"
profile = "sandbox"
}
data "aws_caller_identity" "current" { }
这是 vpc_peer 模块:
resource "aws_vpc_peering_connection" "peer" {
peer_owner_id = "${var.peer_owner_id}"
peer_vpc_id = "${var.peer_vpc_id}"
vpc_id = "${var.vpc_id}"
auto_accept = "${var.auto_accept}"
accepter {
allow_remote_vpc_dns_resolution = true
}
requester {
allow_remote_vpc_dns_resolution = true
}
tags {
Name = "VPC Peering between ${var.peer_vpc_id} and ${var.vpc_id}"
}
}
这是maint.ft中的模块执行
module "peering" {
source = "../modules/vpc_peer"
region = "${var.region}"
peer_owner_id = "<management account number>"
peer_vpc_id = "<vpc-********>"
vpc_id = "${module.network.vpc_id}"
auto_accept = "true"
}
现在,我从“沙盒”提供商使用的 IAM 用户拥有在主账户中的 VPC 中进行 VPC 对等互连的权限。
我使用 AWS 的以下程序:http://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html
不幸的是,我一直失败并出现以下错误:
1 error(s) occurred:
* aws_vpc_peering_connection.peer: Unable to accept VPC Peering Connection: OperationNotPermitted: User 651267440910 cannot accept peering pcx-f9c55290
status code: 400, request id: cfbe1163-241e-413b-a8de-d2bca19726e5
有什么想法吗?
【问题讨论】:
标签: amazon-web-services amazon-vpc terraform peer