def get_flow_log_status()

in code/ct_flowlog_activator.py [0:0]


def get_flow_log_status(target_session, accountId, resourceId, region):
    '''
    Get the VPC Flow Log status, takes VPC ID and Account ID
    '''
    try:
        ec2_client = target_session.client('ec2', region_name=region)
        response = ec2_client.describe_flow_logs(
            Filter=[
                {
                    'Name': 'resource-id',
                    'Values': [
                        resourceId,
                    ]
                },
            ],
        )

        flowlog_filter = 0
        for flowlog in response['FlowLogs']:
            if flowlog['LogDestinationType'] == 's3':
                flowlog_filter = get_flowlog_filter(flowlog['TrafficType'])

        return flowlog_filter

    except Exception as e:
        LOGGER.error("Could not describe Flow Log : {}".format(e), exc_info=True)