๐ Day 19 of 30 Days DevOps Interview Prep Challenge


Series: 30 Days DevOps Interview Preparation
Author: Tathagat Gaikwad
Topic: AWS IAM + S3: Users, Roles & Upload Files
Cloud security and storage are the two pillars every DevOps engineer must master. On Day 19, weโre diving into AWS IAM (Identity & Access Management) and S3 (Simple Storage Service) โ concepts youโll use almost daily in real projects and which are very common in interviews.
๐น What is IAM (Identity & Access Management)?
AWS IAM allows you to manage who can access AWS resources and what actions they can perform.
Key concepts:
Users โ Represent people or applications with permanent credentials.
Groups โ Collection of users with shared permissions.
Roles โ Temporary credentials often used by AWS services (EC2, Lambda).
Policies โ JSON documents that define permissions.
๐ Best Practice: Always follow the Principle of Least Privilege (only give minimum required permissions).
๐น What is Amazon S3 (Simple Storage Service)?
Amazon S3 is object storage built for scalability, durability, and availability.
Data stored as objects in buckets.
Each object = data + metadata + unique key.
Use cases:
โ Store application logs
โ CI/CD artifacts
โ Static website hosting
โ Backups & Disaster Recovery
๐ S3 + IAM = Secure cloud storage for modern DevOps pipelines.
๐น Step-by-Step Practical on AWS
1๏ธโฃ Create an IAM User with S3 Permissions
Go to IAM โ Users โ Add User
Enable Programmatic Access (for CLI).
Attach a policy like
AmazonS3FullAccess
(or custom least-privilege).Download the Access Key & Secret Key.
2๏ธโฃ Configure AWS CLI on Your System
aws configure
Enter Access Key, Secret Key, Region, and Output format.
3๏ธโฃ Create an S3 Bucket
aws s3 mb s3://my-devops-bucket-19
4๏ธโฃ Upload a File to S3
aws s3 cp file.txt s3://my-devops-bucket-19/
5๏ธโฃ List Files in Bucket
aws s3 ls s3://my-devops-bucket-19/
6๏ธโฃ Download a File from S3
aws s3 cp s3://my-devops-bucket-19/file.txt ./file.txt
7๏ธโฃ Attach IAM Role to EC2 for S3 Access (No Keys Required)
Create IAM Role โ Assign
AmazonS3ReadOnlyAccess
.Attach role to your EC2 instance.
Now from EC2, you can run:
aws s3 ls s3://my-devops-bucket-19/
๐ Notice: No keys are needed because IAM Role is managing permissions.
๐น Common Interview Questions & Detailed Answers
Q1: Difference between IAM User and IAM Role?
๐ IAM User = Long-term credentials (username/password or access keys).
๐ IAM Role = Temporary credentials, usually assumed by services (like EC2, Lambda).
Q2: How do you secure an S3 bucket?
๐ Block public access, use IAM policies, enable encryption (SSE-S3 or KMS), enable versioning & MFA delete.
Q3: Whatโs the difference between Bucket Policy and IAM Policy?
๐ Bucket Policy โ Attached directly to the bucket.
๐ IAM Policy โ Attached to users, groups, or roles.
Q4: How does EC2 instance get access to S3 without storing keys?
๐ By assigning an IAM Role to EC2 instance. AWS automatically provides temporary credentials.
Q5: Can S3 be used for hosting static websites?
๐ Yes โ
. Enable "Static Website Hosting" in bucket properties and upload HTML/CSS/JS files.
Q6: What are S3 storage classes?
๐ Standard, Intelligent-Tiering, Standard-IA, One Zone-IA, Glacier, Glacier Deep Archive.
Q7: What is the durability of S3?
๐ 99.999999999% (11 9โs).
๐น Key Takeaways
IAM ensures secure access control.
S3 provides reliable object storage.
Together, they are the foundation of secure DevOps pipelines.
Interviewers often test your ability to explain AND implement these basics.
๐ฎ Coming Next:
๐ Day 20 โ CI/CD + Automation
Stay tuned โ things are getting more hands-on and automation-driven now ๐.
โ
If you found this useful, follow my 30 Days of DevOps Interview Prep Challenge here on Hashnode and LinkedIn.
๐ฌ Comment your questions โ Iโll include them in upcoming posts!
#DevOps #AWS #IAM #S3 #InterviewPreparation #CloudComputing #30DaysOfDevOps
Subscribe to my newsletter
Read articles from Tathagat Gaikwad directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
