This is a very useful feature where we can have both cloudfront and api gateway in the same domain.
Cloudfront has a beautiful feature of origins and behavior with which we can redirect to specific resource based on certain pattern.
This is in assumption that already api gateway and cloudfront is created along with route53 configurations.
First we will create origin for pointing to S3 bucket.
Save the configurations.
Later verify that we have new S3 origin.
Let's create another origin pointing to api gateway.
We now want to create the behavior and attach the origin to it.
We have successfully created the behaviour, default is pointing to S3 bucket.
You can also check https://kuchbhilearning.blogspot.com/2022/10/api-gateway-and-cloud-front-in-same.html
Top comments (0)