USDAForestService / NRM-Grants-Agreements

The focal point for an 18F/TTS collaboration with the USFS Natural Resource Manager (NRM)
Other
8 stars 2 forks source link

ADR for API Gateway and Lambda setup #367

Closed neilmb closed 3 years ago

neilmb commented 3 years ago

This proposes an ADR for how we will use API Gateway and Lambda functions to handle incoming requests.

@AdamUSDA this ADR needs your approval. The easiest way to read it is on this preview link. If you have comments, you can make them here, or indicate your approval with a comment to that effect.

@Cope1-FS @jayrbergjr You are marked as "Informed" on this ADR, so you can read it here if you are interested.

AdamUSDA commented 3 years ago

@neilmb I have a couple of questions.

I think that we both agree that we do not want large and complex API calls. Discrete and concise functionality requires smaller API functions.

I've not worked with a proxy for the AWS gateway so I'm not certain what that would do. Its seems like a workaround to its core functionality? If I remember right Per-path have build in security mapping to certs, allows for testing of API's within the gateway, and you can create mock objects to simulate external integrations. I thought we could also segment environments at the gateway for testing prior to production release? If we use the proxy gateway wouldn't we loose some or all of that functionality?

  1. Have you looked at Step Functions as a way to deal with multistep functions.
  2. If we use a proxy would we loose visibility in Cloud Watch of API usage?
  3. Do we have a simple Angular page that we can use for testing?
  4. Are you planning on using Mock objects instead of a DB?
  5. Do we have a PostgreSQL backend that we plan on using? Access to the DB is an area that I'm concerned about with respect to latency.

Further information needed for technical decision.

neilmb commented 3 years ago

@AdamUSDA

  1. We can definitely use Step Functions if/when we come up with multistep or queuing needs. That isn't the case right now.

  2. Cloud Watch logs from the API Gateway are the same no matter what integration we use to serve those requests, so no visibility is lost.

  3. Building a very simple Angular page for testing is part of our current efforts: #352

  4. We have a DB in the dev environment. I don't have a plan right now to use mocking inside the API Gateway.

  5. We do have a Postgres DB in the dev environment.

What other information is helpful for making a decision?

AdamUSDA commented 3 years ago

@neilmb

Since cost does not appear to be a major factor can you use the API gateway. I think that the API gateway gives us benefits that a straight pass through with ELB would not.

neilmb commented 3 years ago

Yes @AdamUSDA, we'll do API Gateway to connect up with Lambda.

Do you have what you need to approve this ADR as written?