func GetAllVPCRouteTables(svc *ec2.Client) []VPCRouteTable {
	var result []VPCRouteTable
	resp, err := svc.DescribeRouteTables(context.TODO(), &ec2.DescribeRouteTablesInput{})
	if err != nil {
		panic(err)
	}
	for _, routetable := range resp.RouteTables {
		var subnets []string
		for _, assocs := range routetable.Associations {
			if assocs.SubnetId != nil {
				subnets = append(subnets, *assocs.SubnetId)
			}
		}
		table := VPCRouteTable{
			Vpc: VPCHolder{ID: *routetable.VpcId,
				AccountID: *routetable.OwnerId},
			ID:      *routetable.RouteTableId,
			Routes:  parseVPCRoutes(routetable.Routes),
			Subnets: subnets,
		}
		result = append(result, table)
	}
	return result
}
//GetAllVPCRouteTables returns all the Routetables in the account and region
GetAllVPCRouteTables returns all the Routetables in the account and region
// GetAllVPCRouteTables returns all the Routetables in the account and region
func GetAllVPCRouteTables(svc *ec2.Client) []VPCRouteTable {
	var result []VPCRouteTable
	resp, err := svc.DescribeRouteTables(context.TODO(), &ec2.DescribeRouteTablesInput{})
	if err != nil {
		panic(err)
	}
	for _, routetable := range resp.RouteTables {
		var subnets []string
		for _, assocs := range routetable.Associations {
			if assocs.SubnetId != nil {
				subnets = append(subnets, *assocs.SubnetId)
			}
		}
		table := VPCRouteTable{
			Vpc: VPCHolder{ID: *routetable.VpcId,
				AccountID: *routetable.OwnerId},
			ID:      *routetable.RouteTableId,
			Routes:  parseVPCRoutes(routetable.Routes),
			Subnets: subnets,
		}
		result = append(result, table)
	}
	return result
}
func GetAllVPCRouteTables ( svc * ec2 . Client ) [ ] VPCRouteTable { var result [ ] VPCRouteTable resp , err := svc . DescribeRouteTables ( context . TODO ( ) , & ec2 . DescribeRouteTablesInput { } ) if err != nil { panic ( err ) } for _ , routetable := range resp . RouteTables { var subnets [ ] string for _ , assocs := range routetable . Associations { if assocs . SubnetId != nil { subnets = append ( subnets , * assocs . SubnetId ) } } table := VPCRouteTable { Vpc : VPCHolder { ID : * routetable . VpcId , AccountID : * routetable . OwnerId } , ID : * routetable . RouteTableId , Routes : parseVPCRoutes ( routetable . Routes ) , Subnets : subnets , } result = append ( result , table ) } return result }
GetAllVPCRouteTables returns all the Routetables in the account and region
GetAllVPCRouteTables returns all the Routetables in the account and region