How To Fix ‘Caught exception in method AmazonAI_Cloudformation::get_dv_dns_info in class AmazonAI_Cloudformation:’

Table of Contents

Did you encounter this annoying error while setting up your new WordPress website? This error is seen in the AWSforWordpress plugin setup.

AWS has a good development team on its side. And they did a very good job in developing plugins that help WordPress users to move to Amazon Lightsail and use its features.

If you don't know about Amazon Lightsail, it's a virtual private server offered by Amazon at affordable prices. Their prices start very small from $3.50 per month with 1 static IP, 512MB memory, and 1 core processor.

AMAZON LIGHTSAIL PRICING PLANS

Being a vivid user of Amazon's EC2 servers for years now, I was a little hesitant to use this new service from the AWS team. I was sure that they will do it well but still, I was not sure of how good their documentations are for this new service.

Finally last month I gave Lightsail a chance as this product got pretty matured and I gave a brief look into their documentation before jumping in.

Started with the smallest virtual server of 512MB RAM for a small site of mine where we do a lot of SEO tests before implementing any new strategy for our UnderWP's digital marketing clients.

The whole setup went pretty smooth about which I might write up soon in another post. But there was this one point where I got stuck with a nasty error.

The Problem

I found this error when creating a new CloudFront distribution for the website on Amazon Lightsail.

CAUGHT EXCEPTION IN AMAZONAI CLOUDFORMATION

The DNS was being handled by Cloudflare. Unfortunately, AWS documentation does not cover how to handle the DNS when managed by Cloudflare.

They are more in favor of their own DNS management module, Amazon Route 53. It is a wonderful tool to handle all your DNS queries. But personally, I am more in favor of Cloudflare when it comes to DNS.

After going through their documentation for over 2 days here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WordPressPlugIn.html no help was found.

To solve this error, I found the problem was not in the plugin. Because I also read through their plugin which is open source and available on Github for everyone to read: https://github.com/awslabs/aws-for-wordpress/blob/master/admin/AmazonAI-Cloudformation.php

This is when I realize that maybe the problem was in Cloudflare.

The Solution

This error can be solved like this. Go to your Cloudflare account and into the DNS management of the domain you are configuring.

When you are adding the CNAME values provided by the AWSforWordPress plugin. Make sure to switch off the Proxy status option in your Cloudflare dashboard.

CLOUDFLARE DASHBOARD SKIP PROXY

Once this was done, click on the Check status of Cloudfront certificate button on your WordPress dashboard. After a few seconds, you will see that the plugin was successfully able to verify the certificate and goes to the next step of CloudFront Distribution Deployment.

Final Words

This post is to address this error for anyone who faces this error when handling Amazon Lightsail services. If only this error would have been covered in their documentation, I wouldn't have had to write about it.

Overall setting up the Lightsail server for a website has been made an effortless work compared to setting up on EC2 servers by the AWS team. Only this small issue happened when trying to get their additional Cloudfron services to activate on the new website. Hopefully, this will also be addressed and patched up by their team in the future.

Let me know in the comments if this has helped you.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: