Example #1
0
        public bool CreateRouteForRouteTable(
            string peeringConnection,
            string gatewayId,
            string natGatewayId,
            string destinationCidrBlock,
            string routeTableId)
        {
            var request = new CreateRouteRequest();

            if (!string.IsNullOrEmpty(gatewayId))
            {
                request.GatewayId = gatewayId;
            }
            if (!string.IsNullOrEmpty(natGatewayId))
            {
                request.NatGatewayId = natGatewayId;
            }
            if (!string.IsNullOrEmpty(peeringConnection))
            {
                request.VpcPeeringConnectionId = peeringConnection;
            }
            request.DestinationCidrBlock = destinationCidrBlock;
            request.RouteTableId         = routeTableId;

            return(client.CreateRoute(request).Return);
        }