I wrote a script that peers two Transit gateways within the same region. A peering is created however, it is refusing to accept the requests.
resource "aws_ec2_transit_gateway_peering_attachment" "TGW_A_B_Peering_Attachment_Request" {
peer_account_id = aws_ec2_transit_gateway.Transit_GW_A.owner_id
peer_transit_gateway_id = aws_ec2_transit_gateway.Transit_GW_B.id
transit_gateway_id = aws_ec2_transit_gateway.Transit_GW_A.id
peer_region = var.region_2
tags = {
Name = "TGW A and B Peering Request"
}
}
resource "aws_ec2_transit_gateway_peering_attachment_accepter" "TGW_A_B_Peering_Attachment_Accept" {
transit_gateway_attachment_id = aws_ec2_transit_gateway_peering_attachment.TGW_A_B_Peering_Attachment_Request.id
tags = {
Name = "TGW A and B Peering Accept"
}
}
│ Error: accepting EC2 Transit Gateway Peering Attachment (tgw-attach-01aa81f3b119adda2): InvalidParameterValue: Cannot accept tgw-attach-01aa81f3b119adda2 as the source of the peering request.
I think I must be missing something, but I can't tell.