DevOps Project-10
Project Description
The project involves Mounting of AWS S3 Bucket On Amazon EC2 Linux Using S3FS.
Task 1: Setting Up an IAM User
To create an IAM User for your AWS account, follow these steps:
Log in to your AWS Management Console.
Go to the IAM service.
Click on "Users" and then select "Add user."
Enter a username for the new IAM User.
-
Set permissions for S3 access by assigning a policy. You can either create a new policy or use an existing one.
-
Review the user details and create the user. Make sure to save the provided access key and secret access key securely.
Next, install and configure the AWS Command Line Interface (aws-cli) on your EC2 Linux instance:
Log in to your EC2 Linux instance.
If aws-cli is not already installed, run the following commands:
sudo apt update sudo apt install awscli -y
Configure aws-cli by running
aws configure
and providing the access key, secret key, default region, and preferred output format.Test the AWS configuration using
aws s3 ls
to confirm correct setup by listing your S3 buckets.
Create a bucket from the AWS console to complete Task 1.
Task 2: Mounting the S3 Bucket Using S3FS
Now, proceed with mounting the S3 bucket like a file system on your EC2 instance:
Install S3FS by running the following commands:
sudo apt-get update sudo apt-get install s3fs -y
Create a directory for mounting the S3 bucket. For example, make a directory named "bucket" in your home directory:
mkdir /home/ubuntu/bucket
Add some files to the "bucket" directory.
touch pmgoriya.txt Project10.txt Day-89.txt
Mount your S3 bucket using S3FS. Replace <your-bucket-name>
with the actual name of your S3 bucket:
aws s3 sync ~/bucket <your-bucket-name> aws s3 sync /home/ubuntu/bucket s3://pmgoriya-day89
Accessing S3 Data:
Your S3 bucket is now successfully mounted in the "bucket" directory. Navigate and access the contents of the S3 bucket as if they are local files on your EC2 instance.
By following these steps, you have accomplished creating an IAM user, configuring aws-cli, installing and configuring S3FS, and mounting an S3 bucket on your Amazon EC2 instance.
Thanks for following the project. Here the project series of DevOps ends.
Will elaborate what's coming next in the upcoming blog.