As you may have noted, so far, we only have a URL generated by AWS. It is not friendly nor does it use our custom SSL certificate, so we may want to replace it with a custom domain and an SSL certificate. The API Gateway supports it out of the box, but it is very poor support, and first, it needs the certificate to be copies and pasted manually, which is not the best way of enabling SSL, especially for big corporates.
AWS is offering a better solution to solve all these issues and cover the lack of some features of API Gateway. CloudFront is the CDN offering of AWS, and it supports many features. Here, we will set up a CloudFront distribution, which will proxy API Gateway and we will gain many features, such as the following:
- Free SSL support via ACM (Amazon Certificate Manager)
- HTTP/2 and IPv6 support
- GZIP compression
- HTTP caching