def generate_rules()

in lambda.py [0:0]


def generate_rules(ranges):

    global NRULES
    global DESTLIST
    rules = []
    priority=0
    split_ranges = range_splitter(ranges, NRULES)
    # print("split_ranges: "+str(split_ranges))

    for currentranges in split_ranges:
        # print("currentranges"+str(currentranges))
        priority+=1
        rules.append(
            {
                'Priority': priority,
                "RuleDefinition":
                {
                    "Actions": ["aws:allow"],
                    "MatchAttributes":
                    {
                        "Destinations": generate_destlist(DESTLIST),
                        "Sources": generate_sourcelist(currentranges)
                    }
                }
            }
        )
    
    # print("rules"+str(rules))
    return rules