I’ve rather quickly moved on from my locally hosted raspberry pi server into an EC2 instance on AWS. The Raspberry Pi just couldn’t handle all the traffic I was getting!😆I can’t recall if I discussed this previously, but I spent some time porting all my web apps into EC2. I backup all the different databases and files unique to my server to an S3 bucket or two and wrote some scripts to automate the setup process which gives me the ability to “start over” with a clean OS without having to lose any data. I also messed around with some other niceties like building the kernel from source. It was a good experience to acclimate myself to some of the common tools and conventions of the Linux OS.
I wanted to note a few things about my experience using the EC2 Image Builder. I initially thought I would keep all the script language in the Image Builder app by keeping everything in the YAML file for any given recipe I wanted to make. Though it gave me an appreciation for the fickleness of the YAML language, I found it much simpler to write scripts for each operation I needed to complete. This also allowed me to bake some of the scripts into the OS so I could call them for routine maintenance during runtime. The process is very simple: I would test and write the script on a “clean” VM then upload it to its respective S3 bucket which I would then pull in from the YAML file and set it to be executable and have the appropriate privileges and such.
My internet has terrible reliability so my initial motivation to pragmatically generate an instance of my server was so I could use AWS CloudWatch to monitor the availability of my server, and if it wasn’t I could launch an instance of it in EC2 and update the IP mapping through the AWS CLI. Truthfully this isn’t really necessary since I’m the only one looking at my website and I mostly just wanted to mess around with web development so I could familiarize myself better with Linux and the like. This worked in my favor when I switched from cable internet to 5G internet which I can’t host on as easily due to the different architecture of the network. This was the only real reason I moved everything to AWS for the foreseeable future. As a side note, I can’t believe how much better my internet is with 5G; the difference in reliability and speed is transformative.
I have some other things going on that I would like to write about but it’s quite late and I need to sleep.