I've provisioned the following AWS resources to host a static website (via Cloudformation):
- S3 bucket to store the website
- Cloudfront distribution for CDN (for reduced latency)
- Route 53 A record sets that directs traffic to the CDN
I have two completely different websites that I'd like to A/B test to see traffic behavior and conversions. Is it possible to configure A/B testing using the resources that I've configured?
This is what I've tried so far.
Bringing up the same Cloudformation stack for the second website doesn't work cause Cloudfront only allows a single distribution to have a particular CNAME. For example if my website is example.com
, only one Cloudfront distribution can have that CNAME configured to it.
If I try to use the existing Cloudfront distribution there doesn't seem to be a way to split traffic to the two different websites hosted in different S3 buckets. Within the Cloudfront distribution I need to create a second origin and then a behavior. The behavior requires a path + precedence so all the traffic will get sent to one of the websites but not the other.
Is it not possible to configure A/B testing of static websites hosted in S3 with Cloudfront?