jeudi 21 septembre 2017

How do I test a Cloudfront Distribution with the same CNAME as an existing Distribution?

Our team uses Cloudfront to act as a cache + dynamic reverse proxy so that:

example.com/foo

is directed to our Foo elasticbeanstalk environment and

example.com/bar

is directed to our Bar elasticbeanstalk environment.

Now, we have been working on a pretty hefty rearchitecting of some of our example.com services, and now we will want example.com/foo to go to our Foo2 environment, and some other things such as example.com/baz to Baz, and so on (while keeping some existing rules such as /bar to Bar).

We would like not to just "flip the switch" and do it in production, and would like to test our configuration beforehand. So we set up another distribution with the new behaviors and put benign sample applications for Foo2 and Baz. But of course - we cannot set the example.com CNAME on this other distribution, because our CURRENT distribution already uses it.

When we tried to "verify" by editing our /etc/hosts file to point example.com to one of the IP addresses from one of the A records from our new distribution, Cloudfront appeared to just behind the scenes see that we were trying to request the host example.com and routed requests to the environments specified by the behaviors in our current distribution.

Is there any way we can test and verify Cloudfront ruleset changes to a distribution with an existing CNAME without changing the behaviors and rules applied to the current distribution?

Aucun commentaire:

Enregistrer un commentaire