Day 89 Task: Project-10
Project: Mounting AWS S3 Bucket on Amazon EC2 Linux Using S3FS
This project is an excellent introduction to Amazon Web Services (AWS) and will teach you how to mount an AWS S3 bucket on an Amazon EC2 Linux instance using S3FS. By following these steps, you'll gain hands-on experience with AWS, S3, EC2, and S3FS.
🔶 Task: Mounting AWS S3 Bucket on Amazon EC2 Linux Using S3FS
Create an IAM User:
Log in to your AWS Management Console.
Navigate to the IAM (Identity and Access Management) service.
Click on "Users" in the left-hand menu and then "Add user."
Enter a username.
Set permissions for the user. For this project, you can create a policy or use an existing one that allows S3 access.
Review and create the user. Make sure to save the user's access key and secret access key, as you'll need these later.
Install and Configure aws-cli:
Log in to your EC2 Linux instance.
Install the AWS Command Line Interface (aws-cli) if not already installed.
sudo apt update sudo apt install awscli -y
Configure aws-cli with the IAM user's credentials:
aws configure
- Enter your access key, secret key, default region, and preferred output format.
Test AWS Configuration:
Confirm that aws-cli is correctly configured by running a simple AWS command. For example:
aws s3 ls
This command should list your S3 buckets.
Now, create a bucket from the AWS console.
Task 2: Mount the S3 Bucket Using S3FS
Install S3FS:
You can install S3FS on your EC2 instance to mount S3 buckets like a file system.
sudo apt-get update sudo apt-get install s3fs -y
Configure S3FS:
Create a directory where you want to mount the S3 bucket. For instance, create a directory named "bucket" in your home directory.
mkdir /home/ubuntu/bucket
Add some 2–3 files in
/home/ubuntu/bucket
.:~/bucket$ touch Chandresh.txt Project-10.txt Day89.txt
Mount your S3 bucket using S3FS. Replace
your-bucket-name
with the name of your S3 bucket:aws s3 sync ~/bucket <your-bucket-name> aws s3 sync /home/ubuntu/bucket s3://day89-project-10
Access S3 Data:
Your S3 bucket is now mounted in the "bucket" directory.
You can navigate and access the S3 bucket's contents as if they are local files on your EC2 instance.
Project Conclusion
In this project, you've learned how to set up AWS resources, configure aws-cli, install S3FS, and mount an AWS S3 bucket on an Amazon EC2 Linux instance. This knowledge can be invaluable in various scenarios where you need to interact with and use AWS S3 storage as a seamless part of your Linux-based infrastructure.
Explore further and consider automating tasks, managing access permissions, and integrating S3 bucket data into your applications running on EC2 instances. AWS offers a wealth of services, and this project is just the beginning of your journey into the cloud.
Happy Learning :)
Stay in the loop with my latest insights and articles on cloud ☁️ and DevOps ♾️ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).
Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.
#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge #python #docker #Jenkins #Kubernetes #Terraform #AWS #Grafana
Subscribe to my newsletter
Read articles from CHANDRESH PATLE directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
CHANDRESH PATLE
CHANDRESH PATLE
Hi, I'm Chandresh Patle, an aspiring DevOps Engineer with a diverse background in field supervision, manufacturing, and service consulting. With a strong foundation in engineering and project management, I bring a unique perspective to my work. I recently completed a Post Graduate Diploma in Advanced Computing (PG-DAC), where I honed my skills in web development, frontend and backend technologies, databases, and DevOps practices. My proficiency extends to Core Java, Oracle, MySQL, SDLC, AWS, Docker, Kubernetes, Ansible, Linux, GitHub, Terraform, Grafana, Selenium, and Jira. I am passionate about leveraging technology to drive efficient and reliable software delivery. With a focus on DevOps principles and automation, I strive to optimize workflows and enhance collaboration among teams. I am constantly seeking new opportunities to expand my knowledge and stay up-to-date with the latest industry trends. If you have any questions, collaboration ideas, or professional opportunities, feel free to reach out to me at patle269@gmail.com. I'm always open to connecting with fellow tech enthusiasts and exploring ways to contribute to the DevOps community. Let's build a better future through innovation and continuous improvement!