This service provides an entry-point for users/services to add new records to the VEDA data catalog (Spatio-Temporal Asset Catalog, STAC). Its primary functions are to 1) validate the STAC Items before insertion, 2) batch the insertions to reduce load on our STAC database.
STAC items are validated to ensure that:
- It meets the STAC Specification
- All assets are accessible
- Its collection exists
This codebase utilizes the Pydantic SSM Settings module to attempt to load configuration from AWS SSM Parameter Store.
-
Create virtual environment:
python3 -m venv .venv source .venv/bin/activate
-
Install dependencies:
pip install -r api/requirements.txt
-
Run API:
python api/local.py
Note: If no
.env
file is present, the API will connect to resources in thedev
deployment via pydantic-ssm-settings. This requires that yourAWS_PROFILE
be set to the profile associated with the AWS account hosting thedev
deployment.
Please go through the VEDA Contributing Docs for a guide on ingesting and publishing data to the VEDA data store & STAC API.
To retrieve the variables for a stage that has been previously deployed, the secrets manager can be used to quickly populate an .env file.
Note: The environment variables stored as AWS secrets are manually maintained and should be reviewed before using.
export AWS_SECRET_ID=stac-ingestor-env-secret-<stage>
aws secretsmanager get-secret-value --secret-id ${AWS_SECRET_ID} --query SecretString --output text | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' > .env
This script is also available at scripts/sync_env.sh
, which can be invoked with the secret name as an argument:
. scripts/sync_env.sh stac-ingestor-env-secret-<stage>
This project is licensed under Apache 2, see the LICENSE file for more details.