DEV Community

Marco Aguzzi
Marco Aguzzi

Posted on • Originally published at marcoaguzzi.it on

Redirection is over!

Last cloudfront issue

Finally the marcoaguzzi.it domain is actually responding without pointing to dev.marcoaguzzi.cloudns.ph. The last issue preventing the production cloudfront distribution from working was:

  • The lambda@edge function that was linked to development distribution was at version 5, while its cloudformation output value was pointing to version 1
  • The cloudformation stack deployed with production distribution read the output value and pointed to version 1, which wasn’t quite ready yet.
  • Changing the lambda@edge link in production distribution from version 1 to version 5, ending the arn for the lambda with “:5” instead of “:1”, did the trick.

Fire up staging pipeline

Now that both domains have their own distribution responding, it was time to facilitate testing.

I took the cloudformation template with the codepipeline dedicated to deploying the site and parametrized it in order to accomodate different:

  • domains
  • source branches
  • codebuild project
  • s3 bucket

This bullet point list corresponds more or less with the parameter defined in the template, as you can read in the gist https://gist.github.com/maguzzi/ below:

Click to view cloudformation template on gist

How promoting works

So now pushing on dev branch will start compiling the hexo website sources in that branch, and will deploy the website on the s3 bucket served at dev.marcoaguzzi.cloudns.ph, while pushing on main branch will deploy the website on the s3 bucket served at marcoaguzzi.it

Todo

There’s still a lot to do, the points I wrote in previous posts have been moved to in this dedicated page.

Top comments (0)