Exemple #1
0
        private async Task AddPeeringConnectionToRouteTables(SA_Vpc requesterVpc, SA_Vpc accepterVpc, string peerConnectionId)
        {
            //Set requester
            var requesterRouteTables = await ec2Helper.GetRouteTablesByVpc(requesterVpc.VpcId);

            foreach (var routeTable in requesterRouteTables)
            {
                ec2Helper.CreateRouteForRouteTable(peerConnectionId, null, null, accepterVpc.CidrBlock, routeTable);
            }

            var accepterRouteTables = await ec2Helper.GetRouteTablesByVpc(accepterVpc.VpcId);

            foreach (var routeTable in accepterRouteTables)
            {
                ec2Helper.CreateRouteForRouteTable(peerConnectionId, null, null, requesterVpc.CidrBlock, routeTable);
            }
        }