Table of contents
S3(SImple Storage Services)
Amazon Simple Storage Service (Amazon S3) is an object storage service that provides a secure and scalable way to store and access data on the cloud. It is designed for storing any kind of data, such as text files, images, videos, backups, and more.
Task-01
Launch an EC2 instance using the AWS Management Console and connect to it using Secure Shell (SSH).
Create an S3 bucket and upload a file to it using the AWS Management Console.
Access the file from the EC2 instance using the AWS Command Line Interface (AWS CLI).
Step 1: Launch an EC2 instance and connect to it using Secure Shell (SSH). Copy the ssh command and paste it on the terminal.
Step 2: Create an S3 bucket using AWS management console & make sure the name should be unique.
Step 3: Upload a file in this bucket by selecting Add files or using the drag & drop option.
Step 4: Now for accessing this uploading file, we need AWS CLI installed in our instance. Install AWS CLI in an instance by using sudo apt install awscli -y
command.
Then fire the aws configure
command and give access key
and secret access key
.
Step 5: Use the AWS CLI commands to access the files in the bucket such that we will get the URL for temporary access to the bucket's object.
By pasting the URL in the address bar, we can view the contents of the object.
Task-02
Create a snapshot of the EC2 instance and use it to launch a new EC2 instance.
Download a file from the S3 bucket using the AWS CLI.
Verify that the contents of the file are the same on both EC2 instances.
Step 1: Go to the Elastic Block Store
in the AWS EC2 service and click on snapshots. Create a snapshot as shown below:
Step 2: Now we need to create an Image from this snapshot. Select this snapshot and click on the action
button to select create an image from snapshot
Thus we get an image ready for launching a new instance.
Step 3: Now launch an instance from AMI with the remaining details.
Step 4: Here we connect the instance through root login.
[Note: If the instance is connected via ssh, make sure to replace 'root' with 'ubuntu' after pasting the ssh command in the git bash
terminal]
Step 5: As the instance is connected through the root user, we need to configure AWS again.
Step 6: We will now download the file from the S3 bucket to our local machine or instance using the AWS CLI. Once the download is complete, we can compare the contents of the downloaded file with those in the S3 bucket. If they are the same, then we have successfully downloaded the file.
That's all guys, hope it will help you.
If any queries, comment below and give your awesome feedback as well.
References
Thanks for reading my articles.
Keep learning and enjoy the journey.
Rock on and peace out!!