โœ… Day 10 of My Cloud Journey โ˜ โ€“ Hands-on with Amazon S3 using AWS CLI on EC2 ๐Ÿ’ป๐Ÿชฃ

Pratik DasPratik Das
3 min read

Today I rolled up my sleeves and got practical with one of the most valuable cloud combinations: Amazon EC2 + S3 + AWS CLI. This is where you start seeing how DevOps, automation, and cloud-native development come together in real workflows.


๐Ÿ” What Was Today All About?

While the AWS Console is beginner-friendly and visual, the AWS CLI (Command Line Interface) offers powerful automation and scripting capabilities โ€” vital for production-grade environments.

Today, I connected to a running EC2 instance and used the AWS CLI to:

  • Create an S3 bucket

  • Upload/download files

  • Securely manage permissions with IAM Roles

  • Automate storage operations from the terminal


๐Ÿ› ๏ธ What I Did (Hands-On Steps):

1๏ธโƒฃ Launched an EC2 Instance using Amazon Linux 2023
2๏ธโƒฃ SSH Access to connect securely via terminal
3๏ธโƒฃ Installed the AWS CLI (already pre-installed on Amazon Linux)
4๏ธโƒฃ Configured credentials using aws configure (for test/demo only)
5๏ธโƒฃ Created a new S3 bucket directly from the terminal
6๏ธโƒฃ Uploaded and downloaded files
7๏ธโƒฃ Tested IAM Role-based Access without needing access keys ๐ŸŽฏ


๐Ÿ’ป CLI Commands I Practiced

Here's a cheat sheet of the AWS CLI commands I used:

bashCopyEditaws s3 mb s3://my-bucket-name             # Create a bucket
aws s3 ls                                 # List all buckets
aws s3 cp myfile.txt s3://my-bucket-name # Upload a file
aws s3 ls s3://my-bucket-name            # List contents of the bucket
aws s3 cp s3://my-bucket-name/myfile.txt . # Download the file
aws s3 rm s3://my-bucket-name/myfile.txt # Delete the file

๐Ÿ” IAM Roles vs. AWS Configure

MethodDescriptionUse Case
aws configureManually set access key and secretNot recommended for production
IAM RoleAttach role to EC2 for secure, keyless accessโœ… Preferred for automation and security

๐Ÿ“Œ Key Learning: IAM Roles eliminate the need to store credentials in code or config โ€” a major win for security-first cloud architectures.


๐Ÿง  What I Learned

โœ… How EC2 and S3 work together seamlessly
โœ… CLI operations are much faster and perfect for automation
โœ… IAM Roles allow secure, credential-free access to services
โœ… CLI is essential for DevOps tasks, backups, deployments, and more


๐ŸŒ Real-World Use Cases

๐Ÿ”น Automate logs or reports upload to S3
๐Ÿ”น Backup critical files from EC2 to S3
๐Ÿ”น Lambda/EC2 fetching config/data from S3 at runtime
๐Ÿ”น Trigger events when objects are uploaded (using S3 events + Lambda)
๐Ÿ”น Build cron jobs for automated sync between local storage and S3


๐Ÿงฉ Recap: Why AWS CLI Matters in Cloud Workflows

  • Works consistently across platforms (Linux, macOS, Windows)

  • Enables scripting & automation

  • Faster than Console for bulk or repeated tasks

  • Easily integrates into CI/CD pipelines, Bash scripts, and cron jobs

  • Reduces error-prone manual processes.

๐Ÿ“… Whatโ€™s Next?

๐Ÿ” Tomorrow โ€“ Day 11:
Weโ€™ll shift gears from storage to networking as I dive into Amazon VPC (Virtual Private Cloud) and explore:

  • ๐Ÿ”น What is a VPC?

  • ๐Ÿ”น Subnets (Public vs. Private)

  • ๐Ÿ”น Internet Gateway (IGW)

  • ๐Ÿ”น NAT Gateway

  • ๐Ÿ”น Route Tables and how traffic flows in AWS

Understanding VPC is crucial for deploying secure and scalable cloud applications โ€” donโ€™t miss it! ๐Ÿง ๐ŸŒ


๐Ÿท๏ธ Hashtags

#Day10 #30DaysOfCloud #AWS #S3 #AmazonS3 #AWSCLI #CloudComputing #EC2 #IAM #DevOps #LearnInPublic #CloudSkills #Automation #Hashnode #CloudStorage #TruptiMane #ShellScripting #CloudProjects #VPC #Networking #Day11Preview

0
Subscribe to my newsletter

Read articles from Pratik Das directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pratik Das
Pratik Das