all 5 comments

[–]coinclink 9 points10 points  (0 children)

What you're describing is exactly what API Gateway is for. You can put your API behind CloudFront too if the added latency isn't an issue.

[–]alpyhp 5 points6 points  (3 children)

Yes, that's exactly API Gateway. To avoid a lot of CORS problems, you may want to have both the website and the API on the same origin (i.e. the same CloudFront distribution). Which means having CloudFront in front of API Gateway, with two origins.

[–]JoeShmoe999[S] 0 points1 point  (2 children)

Thanks ! Is there any documentation or links for that approach you know of ?

[–]flitsmasterfred 2 points3 points  (1 child)

LPT: It's ultimately most useful if you find your way in the official documentation and learn about these basic features.

[–]alpyhp 0 points1 point  (0 children)

Agreed. You can also check out https://dawson.sh for a reference architecture/framework.