アカウント間でVPCピアを作成しようとしていますが、それを自動受け入れますが、権限エラーで失敗します。ここでTerraformでvpcピアリングをauto_acceptしようとすると、パーミッションエラーが発生するのはなぜですか?
はここmain.tfでプロバイダ
provider "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
任意のアイデア?
ありがとうございましたAnthony。、私はそれを回避する方法を見つけました。 local_execおよびaws cliコマンドを実行して、リモートアカウントのピアを受け入れます。 –
素晴らしい!うれしいことに、あなたの問題を解決しました。 –