Tutorials

Deploying a Static Site to AWS – How Clio Helps Me as a Developer (Part 2)

August 28, 2024 by stein-ove-helset

In the first part of this series, I went through setting up Clio and then using it together with GitHub and Digital Ocean. In this part, I will try to deploy a very simple website to Amazon Web Services. I have never used it, so can Clio really assist me with this?

Before we dive in, I wanted to share the video guide I created for this walk-through. If you prefer to follow along in playback format you can view it here:

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/NMdYanGHRys?si=oLPcnZpHA9CNBSyN” title=”YouTube video player” frameborder=”0″ allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share” referrerpolicy=”strict-origin-when-cross-origin” allowfullscreen></iframe>

Alright let’s get started! I have already built the website, and it’s not more than a front page and an about page. It isn’t very impressive, but it’s enough for this tutorial. It looks like this when I open it locally:

Skjermbilde 2024-08-24 kl. 08.51.16.png

Pre-requisites

-An OpenAPI AI Key

-Clio running on your computer

-An account on AWS

Connection Clio with AWS

I have Clio running and I know that my AWS account is up and running. Now it’s time to try connecting them. I will start of by just asking very simple:

>>> can you help me connect to aws?

Sure, I can help you connect to AWS. To do this, you'll need to configure the AWS CLI with your credentials. Here are the steps:

1. Install AWS CLI: Make sure you have the AWS CLI installed. You can check this by running  AWS --version  in your terminal. If it's not installed, you can download and install it from here https://aws.amazon.com/cli/.
2. Configure AWS CLI: You'll need your AWS Access Key ID, Secret Access Key, and the default region you want to use. You can configure the AWS CLI by running AWS configure  and following the prompts.

Would you like me to check if the AWS CLI is installed on your system?

I tried asking Clio to install the AWS CLI for me, but apparently she couldn’t. But she provided me with a simple guide, and now everything should work. Next step, try connecting again.

Since I’m still not connected to AWS, nothing will work. But I still need to connect, so I asked Clio how to do this and I got a simple guide:

Skjermbilde 2024-08-27 kl. 16.24.08.png

Sounds simple enough. After a few seconds I found everything she needed and I was finally connected and could start interacting with AWS through Clio.

Creating a server

To me, it seems like there are plenty of different ways to deploy a simple site on AWS. As stated previously, I have never done this. So I simply just asked "I have never deployed to AWS before, can you help me with this?"

Skjermbilde 2024-08-27 kl. 16.29.17.png

And then it was as simple as just answering a couple of questions. Most of what I needed to do made sense since I have heard the expressions and terms before. But if I was stuck, I could just simply as Clio for an explanation.

I’m not familiar with ECS, EKS, S3, etc., so I just told Clio to use the one she recommended for me. I guess you can’t really go wrong with a simple two file website 🙂

Testing the page

After a few seconds, the console showed me that the deployment was ready and there was even a URL I could visit:

https://imclio-bucket.s3-us-west-2.amazonaws.com/index.html

How cool is that? First of all, I have now deployed my first site to AWS, but it is working as well. Plus, I did it without running any commands manually. I could just use plain English.

Skjermbilde 2024-08-27 kl. 16.41.33.png

If you want, you can now edit your files locally and ask Clio to re-deploy the site, you can ask Clio to remove the .html in the URL and similar.

Next part

In the next part of this series, I will use Clio to build a simple static blog and deploy it to AWS as well. But this time, I will make it more advanced by including GitHub, Docker, and similar.

Releated Articles