def run_extract()

in configurations/RedshiftConfigTestingLambda.py [0:0]


def run_extract(what_if_timestamp, simple_replay_log_location,
                simple_replay_extract_start_time, simple_replay_extract_end_time,
                simple_replay_extract_overwrite_s3_path,
                bucket_name, redshift_user_name,
                extract_prefix, script_prefix, extract_bootstrap_script, job_definition, job_queue):
    if simple_replay_log_location is None or simple_replay_log_location == "N/A":
        return "N/A"
    else:
        if simple_replay_extract_overwrite_s3_path is None:
            simple_replay_extract_overwrite_s3_path="N/A"

        response = boto3.client('batch').submit_job(jobName='AmazonRedshiftExtract',
                                                    jobQueue=job_queue,
                                                    jobDefinition=job_definition,
                                                    containerOverrides={
                                                        "command": ["sh", "-c",
                                                                    "yum install -y awscli; aws s3 cp $BOOTSTRAP_SCRIPT ./bootstrap.sh; sh ./bootstrap.sh"],
                                                        "environment": [
                                                            {"name": "BOOTSTRAP_SCRIPT",
                                                             "value": extract_bootstrap_script},
                                                            {"name": "BUCKET_NAME", "value": bucket_name},
                                                            {"name": "SIMPLE_REPLAY_EXTRACT_OVERWRITE_S3_PATH",
                                                             "value": simple_replay_extract_overwrite_s3_path},
                                                            {"name": "SIMPLE_REPLAY_LOG_LOCATION",
                                                             "value": simple_replay_log_location},
                                                            {"name": "REDSHIFT_USER_NAME", "value": redshift_user_name},
                                                            {"name": "WHAT_IF_TIMESTAMP", "value": what_if_timestamp},
                                                            {"name": "SIMPLE_REPLAY_EXTRACT_START_TIME",
                                                             "value": simple_replay_extract_start_time},
                                                            {"name": "SIMPLE_REPLAY_EXTRACT_END_TIME",
                                                             "value": simple_replay_extract_end_time},
                                                            {"name": "EXTRACT_PREFIX", "value": extract_prefix},
                                                            {"name": "SCRIPT_PREFIX", "value": script_prefix}
                                                        ]
                                                    })
        return response['jobId']