func (r *RouteTable) UpdateEc2RouteTables(rt []*ec2.RouteTable) error { filter, err := r.Find.GetFilter() if err != nil { return err } r.ec2RouteTables = aws.FilterRouteTables(filter, rt) if len(r.ec2RouteTables) == 0 { return errors.New("No route table in AWS matched filter spec") } for _, manage := range r.ManageRoutes { manage.UpdateEc2RouteTables(r.ec2RouteTables) } return nil }
func (r *RouteTable) UpdateEc2RouteTables(rt []*ec2.RouteTable) error { filter, err := r.Find.GetFilter() if err != nil { return err } r.ec2RouteTables = aws.FilterRouteTables(filter, rt) if len(r.ec2RouteTables) == 0 { if r.Find.NoResultsOk { return nil } return errors.New(fmt.Sprintf("No route table in AWS matched filter spec in route table '%s'", r.Name)) } for _, manage := range r.ManageRoutes { manage.UpdateEc2RouteTables(r.ec2RouteTables) } return nil }