def eventbridge_handler()

in code/ct_flowlog_activator.py [0:0]


def eventbridge_handler(event, context):
    for key in event['detail']['changed-tag-keys']:
        if str.lower(key) in tag_keyword:
            partition = context.invoked_function_arn.split(":")[1]

            if event['detail']['resource-type'] in ['vpc', 'subnet']:
                for resource in event['resources']:
                    resource_id = resource.split(":")[5].split("/")[1]
                    account_id = event['account']
                    region = event['region']
                    tags = event['detail']['tags']
                    resource_type = resource_type_map[event['detail']['resource-type']]
                    target_session = assume_role(account_id, os.environ['assume_role'], os.environ['org_id'])
                    flow_log_handler(target_session, event, partition, resource_id, resource_type, tags, account_id, region)
        else:
            LOGGER.info("Skipping non supported tag: {}".format(key))