# VPC Peering problem cross account

**URL:** <https://discuss.hashicorp.com/t/vpc-peering-problem-cross-account/10680>\
**Category:** Terraform\
**Created:** [June 26, 2020, 5:45pm UTC](https://discuss.hashicorp.com/t/vpc-peering-problem-cross-account/10680 "2020-06-26T17:45:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigred247](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/bigred247/32/8163_2.png) [@bigred247](https://discuss.hashicorp.com/u/bigred247)\
**Post date:** [June 26, 2020, 5:45pm UTC](https://discuss.hashicorp.com/t/vpc-peering-problem-cross-account/10680/1 "2020-06-26T17:45:47Z")

</div>

Hi,

I have an existing VPC peer between AWS Account 1 and AWS Account 2 which was created manually. I am now trying to do the same via Terraform between the same accounts but the result seems to put the acceptor/requestor back to front and when i try to switch around the peer\_owner\_id and peer\_vpc\_id it then suggests the vpc\_id is incorrect. I’ve tried making changes to the syntax but no luck so far.

Currently, I have a working VPC peer which was setup manually. But this is a new AWS account and I need to recreate everything using IAAS via Terraform. I need to replicate the below configuration:

```
Requester VPC owner = 716270604444
Requester VPC ID = vpc-48947456
Requester VPC Region = London (eu-west-2)
Requester VPC CIDRs = 10.222.0.0/16
VPC Peering Connection = pcx-0ff4f1637e9f9e432

Accepter VPC owner = 874855963333
Accepter VPC ID = vpc-0fe237630b00f9387
Accepter VPC Region = London (eu-west-2)
Accepter VPC CIDRs = 10.240.0.0/16"
Peering connection status = Active

```

Currently, my terraform .tf file is setup with the below syntax and as mentioned above it does create the peer but back to front:

> resource “aws\_vpc\_peering\_connection” “vpc-peer-mgmt” {  
> peer\_owner\_id = “874855963333”  
> peer\_vpc\_id = “vpc-48947456”  
> vpc\_id = aws\_vpc.prod-vpc.id  
> }

Any advice would be much appreciated.

Thanks.
