I'm working with AWS, where I have two VPC, say VPC-A and VPC-B and I have VPC peering between the two VPCs. I want tp allow traffic from VPC-B's SecurityGroup to VPC-A's SecurityGroup, I did this with the following call
security_group_a.authorize_ingress(
ip_permissions: [
{
from_port: "-1",
ip_protocol: "-1",
to_port: "-1",
user_id_group_pairs: [
{
description: "Accept all traffic from SecurityGroupB",
group_id: security_group_b.id,
vpc_id: vpc_b.id,
vpc_peering_connection_id: peering_connection_id,
},
],
},
]
)
When I try to put the Security group B in the ingress of Security Group A, I'm getting an error:
Error: Error authorizing security group rule type ingress: InvalidGroup.NotFound: You have specified two resources that belong to different networks
What am I doing wrong? Any suggestion?