
High Availability Architecture with AWS CLI

PREREQUISITES:
Create an AWS account.
Install AWS CLI 2 in Windows.
Configure AWS CLI with IAM user.
What is AWS CLI ?
The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
The AWS CLI v2 offers several new features including improved installers, new configuration options such as AWS Single Sign-On (SSO), and various interactive features.
What is AWS S3 service ?

Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as data lakes, websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. Amazon S3 is designed for 99.999999999% (11 9’s) of durability, and stores data for millions of applications for companies all around the world.
What is AWS CloudFront Service ?

Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment. CloudFront is integrated with AWS — both physical locations that are directly connected to the AWS global infrastructure, as well as other AWS services. CloudFront works seamlessly with services including AWS Shield for DDoS mitigation, Amazon S3, Elastic Load Balancing or Amazon EC2 as origins for your applications, and Lambda@Edge to run custom code closer to customers’ users and to customize the user experience. Lastly, if you use AWS origins such as Amazon S3, Amazon EC2 or Elastic Load Balancing, you don’t pay for any data transferred between these services and CloudFront.
LET’S CREATE A THE ARCHITECTURE :-)
- LAUNCHING AWS INSTANCE
aws ec2 run-instances — image-id ami_ — instance-type _type_id — count no_of_instance — subnet-id -a57e77cd — security-group-ids group_id — key-name key_name
The way I used to launch the instance is little bit different i user user_data part which lets u run the script during the booting of instance using that i installed the apache webserver.

Here is the script i used this code run automatically during booting of instance.

2. Creating the volume
aws ec2 create-volume — size 1 — availability-zone ap-south-1a

3. Attaching the Volume
aws ec2 attach-volume — volume-id volumeid — instance-id instance id — device device (ex. /dev/sdc)

4. Creating the Partition

5. Creating S3 Bucket.

6. Uploading data inside the S3 Bucket

7. Launching the cloud-front for cdn of my s3 bucket Storage.

At last configuring webserver.
