This is a deployment repo for MAAP's instance of the Federated Collection Discovery application.
The resources get deployed to the SMCE-MAAP AWS account by the
deploy
Github Actions workflow where
you must specify the deployment environment (dev
or test
) and the
API version to use.
The Github Action workflow will deploy:
- the Federated Collection Search API
- Lambda function with an API gateway endpoint
- alias for a url at maap-project.org
- the Federated Collection Search client application
- React app built by yarn and uploaded to S3, served by CloudFront
- alias for a url at maap-project.org
-
The corresponding alias records for maap-project.org are managed in the UAH-MAAP AWS account and must be manually entered/updated to redirect requests to the resources in this stack.
-
We have to checkout the client app repo and build the React app then upload the contents to the S3 bucket after it is deployed. Maybe there is a better way to do this!
Each deployment requires several attributes to be specified, these are handled
in the
Github Environments
and are passed as environment variables in the deploy
step of the workflow.
The dev
and test
environments share some of these in common but the custom
domain names differ between the two environments:
*.dit.maap-project.org
for thetest
environment*.maap-project.org
for thedev
environment
The AWS infrastructure is defined in a Python CDK application.
You can install the Python dependencies for the project with
this command from the Makefile
(requires Node,
, Poetry:
make install
This will create a virtual environment if you don't already have one, will use an existing one if it is activated.
To deploy the resources to an AWS account from your local environment,
you will need to define some variables in your environment (or in a .env-cdk
file).
Reference config.py
for all of the possible options.
At a minimum you will want to define STAC_API_URLS
which will define the list of
STAC APIs that the Federated Collection Discovery API will search.
You can put this in .env-cdk
which will get automatically used by the CDK app:
# comma separated list of STAC API urls:
STAC_API_URLS=https://stac.maap-project.org/,https://openveda.cloud/api/stac/,https://catalogue.dataspace.copernicus.eu/stac
To deploy the AWS resources:
make deploy
This will deploy the API and create the infrastructure for the client application,
but you will still need to build the client application and upload it to the S3
bucket to complete the deployment!
Check out the deploy workflow
for inspiration
if you want to do this locally.
TODO: Add docker-based client app build process
To destroy the stack:
make destroy