CloudFront and API Gateway service on same domain


I want to:

  • Distribute the static part of the website (html, css, js) on my domain
  • Put API Gateway services on my domain under a folder,

How do I accomplish this?

In route 53, from what I understand I can only point to one cloudfront distribution, so I am choosing my S3/CloudFront enabled bucket.

So, the end result should be, in order of priority/mapping:

  •* <-> API Gateway <-> Lambda <-> DynamoDB
  •* <-> CloudFront <-> S3 bucket contents

In what way can I achieve this? And if not, what are my alternatives since I need to bend to the same origin principle requirement in web browsers.


You would setup CloudFront with two origins, S3 and API Gateway, and configure CloudFront to use the API Gateway origin for all requests that start with /v1

Leave a Reply