cdk/cdk/afc_lambdas/create_export.py [33:62]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def create_forecast_export_handler(event, context):
    """
    """

    payload = event["input"]["Payload"]
    prefix = payload["prefix"]

    update_status_json(payload, "IN_PROGRESS:create_forecast_export",
        payload["StatusJsonS3Path"])

    AFC_FORECAST_EXPORT_JOB_NAME = f"{prefix}_ExportJob"

    resp = afc.create_forecast_export_job(
        ForecastExportJobName=AFC_FORECAST_EXPORT_JOB_NAME,
        ForecastArn=payload["ForecastArn"],
        Destination={
            "S3Config": {
                "Path": os.path.join(payload["s3_export_path"], prefix),
                "RoleArn": os.environ["AFC_ROLE_ARN"],
            }
        }
    )

    resp_out = payload
    resp_out["ForecastExportJobArn"] = resp["ForecastExportJobArn"]

    update_status_json(resp_out, "DONE:create_forecast_export",
        payload["StatusJsonS3Path"])

    return resp_out
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



cdk/cdk/afc_lambdas/index.py [208:237]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def create_forecast_export_handler(event, context):
    """
    """

    payload = event["input"]["Payload"]
    prefix = payload["prefix"]

    update_status_json(payload, "IN_PROGRESS:create_forecast_export",
        payload["StatusJsonS3Path"])

    AFC_FORECAST_EXPORT_JOB_NAME = f"{prefix}_ExportJob"

    resp = afc.create_forecast_export_job(
        ForecastExportJobName=AFC_FORECAST_EXPORT_JOB_NAME,
        ForecastArn=payload["ForecastArn"],
        Destination={
            "S3Config": {
                "Path": os.path.join(payload["s3_export_path"], prefix),
                "RoleArn": os.environ["AFC_ROLE_ARN"],
            }
        }
    )

    resp_out = payload
    resp_out["ForecastExportJobArn"] = resp["ForecastExportJobArn"]

    update_status_json(resp_out, "DONE:create_forecast_export",
        payload["StatusJsonS3Path"])

    return resp_out
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



