A Journey in Learning

CloudFront Errors

Until something breaks its difficult to figure out what you did wrong. Recently I was testing my landing page and kept receiving the following error:

403 ERROR
The request could not be satisfied.
Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)
Request ID: mIi_OcCpx4gNEgrGYYoGVov9-b8rPBtOt_lVWU2tnAbcuGREdiJqdA==

At first I ignored the error and assumed that it was a throttling or usage issue, then after some digging realized that the domain itself that was being queried was

Alkisnar.IO rather than https://www.alkisnar.io/

I then remembered that Cloudfront had CNAME designations and that most likely I designated www.alkisnar.io as my cname without adding alkisnar.io. I understand that alkisnar.io may be seen as a HTTP request so I also had Cloudfront forward this request to HTTPS. However after removing my old SSL to apply a new SSL with two CNAME values I received this error:

aws_cloudfront_distribution.cdn: IllegalUpdate: Only one viewer certificate change may be in progress at a time.
	status code: 400, request id: 1ba221a9-1dac-11e7-bd65-89380dff957f

I now understand that in order to remove and add a new certificate the change to remove an SSL must propagate cloudfront and be confirmed as deployed. I waited a while and reapplied the proper SSL, proper CNAME configuration and hopefully solved this problem for now.