Fix Localstack region is always null in getAccepterVpcInfo after vpc …
diff --git a/localstack/services/ec2/ec2_starter.py b/localstack/services/ec2/ec2_starter.py
index c2a6dea1cfc79..9ce87f25fa85b 100644
--- a/localstack/services/ec2/ec2_starter.py
+++ b/localstack/services/ec2/ec2_starter.py
@@ -1,6 +1,7 @@
 from moto.ec2 import models as ec2_models
 from moto.ec2.exceptions import InvalidPermissionNotFoundError
 from moto.ec2.responses.reserved_instances import ReservedInstances
+from moto.ec2.responses import vpc_peering_connections
 from localstack import config
 from localstack.services.infra import start_moto_server
 
@@ -48,6 +49,23 @@ def describe_reserved_instances(self):
     ReservedInstances.purchase_reserved_instances_offering = purchase_reserved_instances_offering
     ReservedInstances.describe_reserved_instances = describe_reserved_instances
 
+    # Patch: region is null in describe_vpc_peering_connections function response
+    # https://github.com/localstack/localstack/issues/2147¯¯
+    vpc_conns = vpc_peering_connections.DESCRIBE_VPC_PEERING_CONNECTIONS_RESPONSE
+    if '<region>' not in vpc_conns:
+        # Add region for requesterVpcInfo
+        vpc_conns_patched = vpc_conns.replace(
+            '</requesterVpcInfo>',
+            ' <region>{{ vpc_pcx.vpc.ec2_backend.region_name }}</region>\n</requesterVpcInfo>'
+        )
+        # Add region for accepterVpcInfo
+        vpc_conns_patched = vpc_conns_patched.replace(
+            '</accepterVpcInfo>',
+            ' <region>{{ vpc_pcx.peer_vpc.ec2_backend.region_name }}</region>\n</accepterVpcInfo>'
+        )
+
+        vpc_peering_connections.DESCRIBE_VPC_PEERING_CONNECTIONS_RESPONSE = vpc_conns_patched
+
 
 def start_ec2(port=None, asynchronous=False, update_listener=None):
     patch_ec2()
diff --git a/tests/integration/test_ec2.py b/tests/integration/test_ec2.py
index 9a5aaf8bc9440..3627377b562de 100644
--- a/tests/integration/test_ec2.py
+++ b/tests/integration/test_ec2.py
@@ -83,3 +83,85 @@ def test_reserved_instance_api(self):
             OfferingType='Heavy Utilization'
         )
         self.assertEqual(rs['ResponseMetadata']['HTTPStatusCode'], 200)
+
+    def test_vcp_peering_difference_regions(self):
+        region1 = 'ap-southeast-1'
+        region2 = 'us-east-2'
+        ec2_client1 = aws_stack.connect_to_service(service_name='ec2', region_name=region1)
+        ec2_client2 = aws_stack.connect_to_service(service_name='ec2', region_name=region2)
+
+        cidr_block1 = '192.168.1.2/24'
+        cidr_block2 = '192.168.1.2/24'
+        peer_vpc1 = ec2_client1.create_vpc(CidrBlock=cidr_block1)
+        peer_vpc2 = ec2_client2.create_vpc(CidrBlock=cidr_block2)
+
+        self.assertEqual(peer_vpc1['ResponseMetadata']['HTTPStatusCode'], 200)
+        self.assertEqual(peer_vpc1['Vpc']['CidrBlock'], cidr_block1)
+        self.assertEqual(peer_vpc2['ResponseMetadata']['HTTPStatusCode'], 200)
+        self.assertEqual(peer_vpc2['Vpc']['CidrBlock'], cidr_block2)
+
+        cross_region = ec2_client1.create_vpc_peering_connection(PeerVpcId=peer_vpc2['Vpc']['VpcId'],
+                                                                 VpcId=peer_vpc1['Vpc']['VpcId'],
+                                                                 PeerRegion='us-east-2'
+                                                                 )
+        self.assertEqual(peer_vpc1['ResponseMetadata']['HTTPStatusCode'], 200)
+        self.assertEqual(
+            peer_vpc1['Vpc']['VpcId'],
+            cross_region['VpcPeeringConnection']['RequesterVpcInfo']['VpcId']
+        )
+        self.assertEqual(
+            peer_vpc2['Vpc']['VpcId'],
+            cross_region['VpcPeeringConnection']['AccepterVpcInfo']['VpcId']
+        )
+
+        accept_vpc = ec2_client2.accept_vpc_peering_connection(
+            VpcPeeringConnectionId=cross_region['VpcPeeringConnection']['VpcPeeringConnectionId']
+        )
+        self.assertEqual(accept_vpc['ResponseMetadata']['HTTPStatusCode'], 200)
+        self.assertEqual(
+            peer_vpc1['Vpc']['VpcId'],
+            accept_vpc['VpcPeeringConnection']['RequesterVpcInfo']['VpcId']
+        )
+        self.assertEqual(
+            peer_vpc2['Vpc']['VpcId'],
+            accept_vpc['VpcPeeringConnection']['AccepterVpcInfo']['VpcId']
+        )
+        self.assertEqual(
+            cross_region['VpcPeeringConnection']['VpcPeeringConnectionId'],
+            accept_vpc['VpcPeeringConnection']['VpcPeeringConnectionId']
+        )
+
+        requester_peer = ec2_client1.describe_vpc_peering_connections(
+            VpcPeeringConnectionIds=[accept_vpc['VpcPeeringConnection']['VpcPeeringConnectionId']]
+
+        )
+        self.assertEqual(len(requester_peer['VpcPeeringConnections']), 1)
+        self.assertEqual(
+            region1,
+            requester_peer['VpcPeeringConnections'][0]['RequesterVpcInfo']['Region']
+        )
+        self.assertEqual(
+            region2,
+            requester_peer['VpcPeeringConnections'][0]['AccepterVpcInfo']['Region']
+        )
+
+        accepter_peer = ec2_client2.describe_vpc_peering_connections(
+            VpcPeeringConnectionIds=[accept_vpc['VpcPeeringConnection']['VpcPeeringConnectionId']]
+        )
+        self.assertEqual(len(accepter_peer['VpcPeeringConnections']), 1)
+        self.assertEquals(
+            region1,
+            accepter_peer['VpcPeeringConnections'][0]['RequesterVpcInfo']['Region']
+        )
+        self.assertEquals(
+            region2,
+            accepter_peer['VpcPeeringConnections'][0]['AccepterVpcInfo']['Region']
+        )
+
+        # Clean up
+        ec2_client1.delete_vpc_peering_connection(
+            VpcPeeringConnectionId=cross_region['VpcPeeringConnection']['VpcPeeringConnectionId']
+        )
+
+        ec2_client1.delete_vpc(VpcId=peer_vpc1['Vpc']['VpcId'])
+        ec2_client2.delete_vpc(VpcId=peer_vpc2['Vpc']['VpcId'])

- Patch function describe_vpc_peering_connections
- Add integration test

Issue fixed:
Localstack region is always null in getAccepterVpcInfo after vpc peering #2147
