IMAP-Science-Operations-Center / sds-data-manager

MIT License
0 stars 9 forks source link

SPIKE - Investigate how we want to set up our APIs #66

Closed greglucas closed 1 year ago

greglucas commented 1 year ago

Description

We are going to want our APIs to live at some easy to remember url (domain.com/api or api.domain.com). We need to investigate how we want to set this up within AWS's architecture.

Requirements

Nice to have or Goal Requirements

Additional notes

A few other things to consider: Do we know how many endpoints we want? Do we want everything living at the URL, or do we want multiple urls (api1, api2, ...).

Related tickets


Follow up tickets

This spike is not considered complete until at least one follow up issue is created.

Below is the template for the response to this ticket. Add as many solutions as needed, but preferably include 2-5 for discussion. The response should be posted as a comment on this issue, or linked in a comment.

Solution 1

Write an overview of the solution here.

Pros:

Cons:

Additional notes:

Solution 2

Write an overview of the solution here.

Pros:

Cons:

Additional notes:

Summary

Write up a summary of your findings, including your preferred solution.

laspsandoval commented 1 year ago

Solution 1 : domain.com/api

Pros:

Cons:

Solution 2 : api.domain.com

Pros:

Cons:

Additional Information

Requirements:

Notes:

Summary

After evaluating the pros and cons, as well as considering our concerns related to security groups, we have decided to opt for the ANAME/subdomain method (api.domain.com) for organizing our APIs. This approach provides several benefits: better organization, enhanced isolation, independent scalability, and flexible versioning.

By choosing the api.domain.com method, we are selecting a more scalable and flexible solution that addresses our security concerns and better aligns with the needs of a growing API ecosystem. While this approach may introduce slightly more complex SSL and DNS management, we can mitigate these drawbacks by using a wildcard SSL certificate and proper DNS management practices.

greglucas commented 1 year ago

Great summary, thanks for looking into this @laspsandoval! I think that sounds good.

cc @bryan-harter, @bmcclellan-cu for any comments/thoughts before implementation.

bryan-harter commented 1 year ago

Were there any thoughts about how the backend will be set up, or will that be a separate spike?

bmcclellan-cu commented 1 year ago

I don't have any concerns, this my preference as well. A single SSL cert of *.base_domain_name should cover all of them (getting this cert correct is important, b/c if you need to change it later on you'll have to destroy all dependent stacks). It will require separate Route53 A records for all of the API, but the CDK takes care of creating those for you.

bryan-harter commented 1 year ago

I believe this is finished, right? Feel free to close this @laspsandoval

bryan-harter commented 1 year ago

I can just close, this was completed by https://github.com/IMAP-Science-Operations-Center/sds-data-manager/pull/102