route53

Migrate my note flask app from ecs to pi

So to cutdown some cost on hosting my tnote flask app - tnote.tdinvoke.net, Iā€™m hoping to move it down to my pi4. But I donā€™t want to deal with port forwarding and ssl certificate setup. So enter cloudflare tunnel, itā€™s not perfectly safe as cloudflare can see all traffic going to the exposed sites but since these are just my lab projects, I think I should be fine.

I need to use my tdinvoke.net domain for the sites, so I had to migrate my r53 dns setup over to cloudflare.

  • Move all my dns records to cloudflare manually. I donā€™t have much so itā€™s pretty painless. Note: All my alias records to aws cloudfront need to be created as CNAME - ā€˜DNS onlyā€™ on cloudflare.
  • Point my registered domain name-servers to cloudflare name-servers.

Migration from ecs was not too bad since I just need to spin up the containers on my pi.

Hereā€™s an overview flow of the setup:

More information on cloudflare tunnel and how to setup one - here.

Hosting a simple Code Editor on S3

I got this old code editor project sitting in github without much description - repo link. So I thought why not try to host it on S3 so I could showcase it in the repo.

Also itā€™s a good pratice to brush up my knowledge on some of the AWS services (S3, CloudFront, Route53). After almost an hour, I got the site up so itā€™s not too bad. Below are the steps that I took.

  1. Create a S3 bucket and upload my code to this new bucket - ceditor.tdinvoke.net.

  2. Enable ā€œStatic website hostingā€ on the bucket

  3. Create a web CloudFront without following settings (the rest are set with default)

    1. Origin Domain Name: endpoint url in S3 ceditor.tdinvoke.net ā€˜Static Website Hostingā€™
    2. Alternate Domain Names (CNAMEs): codeplayer.tdinvoke.net
    3. Viewer Protocol Policy: Redirect HTTP to HTTPS
    4. SSL Certificate: Custom SSL Certificate - reference my existing SSL certificate
  4. Create new A record in Route 53 and point it to the new CloudFront Distributions

Aaand here is the site: https://codeplayer.tdinvoke.net/

Next I need to go back to the repo and write up a readme.md for it.

How to verify google search with route53

Just recently got this site on google search, totally forgot about it when I created the site.
The process is quite easy. Follow the instructions on this link should cover the task.
Might take from 10 minutes to 5 hours for the TXT record to populate, so be patient!