Hello all.
I have a need for a small service that serves as an intermediate http proxy between my clients (mobile app) and a Database server (outside of AWS - receiving http requests).
I can think of a small NodeJS function that accepts the clients' http requests, routs them to the DB server, listens for the response coming back from the DB server and sends it back to the client.
The anticipated load is not much at all, maybe 1,000 such requests every day.
No need for extraordinary security measures, nor load balancing or multi region CDN's and such.
I mostly need this solution to bypass CORS limitation with the target DB service that requires some middle-ware and can't serve my Angular app directly from my dev machine / mobile.
There is a secret token to be sent to the target DB server, that can maybe be served from this intermediate proxy service, instead of including it with the client request.
I can see multiple possibilities to implement in AWS, differ in price and implementation, and I cannot decide which would serve me best with the minimum costs (if any). Some examples I could think of:
- AWS API GW
- AWS API GW + Lambda
- Lambda (is it possible without the API GW service)
- NodeJS on an EC2
- AWS Amplify (sounds like an overkill for this usecase?)
- Amazon LightRail (looks expensive, though?)
Please advise on the most suitable service to use, in your mind, that will bear minimum costs and be relatively easy to configure/implement.
Thank you!
Mor
#3: Yes, Lambda with HTTPs endpoints is available: https://aws.amazon.com/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/
If your DB is "talking" HTTP -> why not to consider CloudFront with DataBase as custom Origin? You could configure whatever CORS you need in CF, and you could add Customer header for Auth on CF as well. In this case CF will be your proxy. No need for Lambdas. If you need some code - you could add L@E for additional logic. I dont think CF here as overkill as CDN - it's just transport you need with some features. CloudFront also have FreeTier: 1 TB of data transfer out 10,000,000 HTTP or HTTPS Requests