NASA-PDS / planetary-data-cloud

PDS Cloud Migration documentation, issue, tracking and simple tools for assisting in the PDS hybrid cloud study and migration efforts.
Apache License 2.0
0 stars 0 forks source link

Investigate AWS Cloudfront Functions or lambda@edge for node routing of registry API requests #23

Closed jimmie closed 2 years ago

jimmie commented 2 years ago

At the Cloudfront level we would like to be able to specify a particular DN within the URL such that the request is routed to the associated registry - that is, the DN component should be used to populate the x-request-node HTTP header. This can be performed using a lambda function within Cloudfront (aka lambda@edge). This task is to investigate lambda@edge, propose the URL pattern(s) and estimate LOE for the implementation.

We will need to work out the details of the URL such that specification of the DN is not ambiguous with respect to requests directed to the EN (by not specifying a node abbr).

This will also enable the swagger UI for a specific DN to be accessed via browser.

jimmie commented 2 years ago

One key area of investigation is that this will work w/ relative URLs which I believe swagger utilizes.

tloubrieu-jpl commented 2 years ago

Generally speaking we want the PDS APIs URL to follow the pattern https://pds.nasa.gov/{app}/{version}/....

Then we propose to implement the API node's url as follow: http://pds.nasa.gov/registry/ --> goes to EN registry http://pds.nasa.gov/registry-geo/ --> goes to GEO registry ...

@jordanpadams we discussed that at the breakout today, any other thoughts on that ?

tloubrieu-jpl commented 2 years ago

@jimmie @jordanpadams, I have just seen that at some point we were thinking to have api as well in the url (see ticket https://github.com/NASA-PDS/pds-api/issues/136)

that would give us: http://pds.nasa.gov/api/registry/{version}

since we can also have an api for the Doi service: http://pds.nasa.gov/api/doi/{version}

jordanpadams commented 2 years ago

@tloubrieu-jpl copy that. do we want to maybe make this microservice "search" since it is really our PDS Search API (sitting on top of the registry)?

jordanpadams commented 2 years ago

@jimmie ☝️

jimmie commented 2 years ago

Another (newer) option is Cloudfront Functions - although this is limited to javascript whereas Lambda@Edge supports both javascript and python. Do we have javascript experts on the team?

tloubrieu-jpl commented 2 years ago

@jordanpadams we can make it registry become search. It is more user oriented I think. @jimmie , @eddiesarevalo is our javascript expert.

jimmie commented 2 years ago

Cloudfront Function created and tested - registry-api PR #100 created and awaiting review.

jimmie commented 2 years ago

PR #100 reviewed and merged.