High Availability Architecture with AWS CLI
Let’s start with our work -
🔰 Create High Availability Architecture with AWS CLI 🔰
🔅The architecture includes-
🔹 Webserver configured on EC2 Instance
🔹 Document Root(/var/www/html) made persistent by mounting on EBS Block Device.
🔹 Static objects used in code such as pictures stored in S3
🔹 Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.
🔹 Finally place the Cloud Front URL on the webapp code for security and low latency.
🔅 At very first step , we need to configure the AWS profile. Here I have used already configured profile.
Now , Instance is created
Here, we can see instance is launched successfully.
Next, EBS Volume is created
Here , we can see volume is created successfully
After that this above volume is attached to instance that we have created
Here, our created EBS volume is successfully attached to the instance.
Now , we will create partition by using following command-
Here , we can see partition is created successfully
Formatting a partition by using command-
Mounting a directory /var/www/html/ on created partition and checking the mounted partitions-.
Let’s install apache webserver by using following command-
yum install httpd -y
Apache webserver has been installed successfully, now we have to start the apache services and will see server status.
Our apache webservice is activated now.
🔅 Now, we will create a file with .html extension and here we can see there is not any file. So, created an html page, we have html page but it’s not executable. To execute this file use chmod +x file_name.html
We can see file is in green color that means it is executable now.
Now, using Public IP of EC2 Instance, we can access the webpage.
After we will create s3 bucket-
Here , we can see s3 bucket has been created
Now, we will upload an image in created s3 bucket.
Image is successfully uploaded..
As our object is not publicly accessible, so will make it publicly readable and for that I have used the following command. ACL stands for Access Control List.
By using URL provided by s3 to the object we can access the image.
🔅 Then creation of a cloudfront distribution-
Cloud front is successfully created
Cloudfront has a Domain Name by using this domain name, we can access the content with fast speed and low latency.
finally our image has been executed on our webserver!!
Yay !! we did our task successfully.
Thank you for Reading!!!