diff --git a/batch/python/export_to_gee.py b/batch/python/export_to_gee.py index f2e016014..d08954967 100644 --- a/batch/python/export_to_gee.py +++ b/batch/python/export_to_gee.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import json import os @@ -9,12 +11,13 @@ EE_PROJECT = "forma-250" GCS_BUCKET = "data-api-gee-assets" -GCS_SECRET_KEY_ARN = os.environ["GCS_SECRET_KEY_ARN"] +GCS_SECRET_KEY_ARN = os.environ["AWS_GCS_KEY_SECRET_ARN"] GCS_CREDENTIALS_FILE = "gcs_credentials.json" +AWS_REGION = os.environ["AWS_REGION"] def set_google_application_credentials(): - client = boto3.client("secretsmanager") + client = boto3.client("secretsmanager", region_name=AWS_REGION) response = client.get_secret_value(SecretId=GCS_SECRET_KEY_ARN) with open(GCS_CREDENTIALS_FILE, "w") as f: diff --git a/batch/scripts/cogify.sh b/batch/scripts/cogify.sh index 605776d80..4dba39d46 100755 --- a/batch/scripts/cogify.sh +++ b/batch/scripts/cogify.sh @@ -42,7 +42,7 @@ fi aws s3 cp cog.tif "${TARGET}" if [ -n "$EXPORT_TO_GEE" ]; then - python export_to_gee.py --dataset "${DATASET}" --implementation "${IMPLEMENTATION}" + export_to_gee.py --dataset "${DATASET}" --implementation "${IMPLEMENTATION}" fi set +x