cds-snc / digital-canada-ca

Website for the Canadian Digital Service / Site Web du Service numérique canadien
https://digital.canada.ca/
MIT License
49 stars 29 forks source link

Consolidate AWS accounts for site Hosting #2146

Open brdunfield opened 3 years ago

brdunfield commented 3 years ago

Currently, the site is being hosted in an older AWS account, while the new CMS infrastructure (including media), are being hosted in a newer one.

We need to eventually move the site so that it's all being handled in the same, newer account.

dj2 commented 3 years ago

Is this a matter of spinning up new servers under the new account, getting all the deployment stuff up and running with those servers and then switching over a load balancer somewhere? Or, are there more steps we need handle?

brdunfield commented 3 years ago

I am not 100% on the infrastructure / deployment in place on the old site as I never touched it in the last few months. I know it's a static site hosted off of two s3 buckets (one per language). It's probably not more complicated than your question, if I had to guess?

dj2 commented 3 years ago

@maxneuvians would you know what needs to be done here, or who we should poke to figure out what we need to do?

dj2 commented 3 years ago

@dsamojlenko as an alternative guess a who would know what we'll need to do to the infra to consolidate the AWS hosting?

dj2 commented 3 years ago

Chatted with Dave and came up with a few tasks to migrate the site. Before going down that route, one question that came up is, can we shift the site to GitHub pages? There was previously issues around custom domains and SSL certs, do we know if those have been resolved? Is moving to GitHub pages a possibility?

The following are based on staying on AWS. Some of them are relevant either way, some aren't.

  1. Switch from Lets Encrypt to AWS for certs. This should simplify the site infrastructure and remove the need for the renewal lambda.
  2. Shutdown cert renewal lambda
  3. Setup new S3 and Cloudfront in the new AWS account
  4. Convert deploy scripts to send to both old and new S3 buckets
  5. Verify new S3 bucket serving of the site works as expected
  6. Repoint DNS at new Cloudfront
  7. Remove old S3 and Cloudfront from deployment script
  8. Determine if old S3 buckets need to be saved or can be removed
  9. Remove old S3 buckets and Cloudfront.