Introduction:
Welcome to Day 38 of your 90DaysOfDevOps Challenge! Today, we're diving into the fundamentals of Amazon Web Services (AWS) – a cloud platform that's essential for every DevOps engineer. If you haven't explored AWS yet, now's the perfect time to start.
AWS Overview:
AWS, or Amazon Web Services, is a top cloud computing platform offering various services like computing power, storage, databases, and more over the internet. It's known for its scalability, reliability, and security, serving businesses of all sizes globally.
AWS features compute services like EC2 and Lambda, storage solutions like S3 and EBS, databases like RDS and DynamoDB, networking services, and robust security measures with IAM and KMS. It enables organizations to innovate, scale, and deploy applications efficiently.
IAM Demystified:
AWS Identity and Access Management (IAM) is a crucial component for securely managing access to AWS resources. IAM allows you to centrally control permissions, determining who can access specific AWS resources.
Task1:
- creating an IAM user with EC2 access, launching a Linux instance, and installing Jenkins and Docker via a Shell Script, follow these simplified technical steps:
Creating an IAM User with EC2 Access:
Log in to the AWS Management Console using your root user credentials.
Navigate to the IAM service by typing "IAM" in the search box and selecting "Users" from the left menu.
Click on "Create user" and choose a username.
Select "Programmatic access" and proceed.
Choose "Attach existing policies directly" and select "AmazonEC2FullAccess" policy.
Complete the user creation process by clicking "Create user".
Launching a Linux Instance using IAM User:
Sign in to your AWS account using the IAM user credentials.
Access the EC2 service and click on "Launch instance".
Choose a Linux AMI (Amazon Machine Image) for your instance.
After launching the instance, connect to the server.
Installing Jenkins and Docker via Shell Script:
Run the following Shell Script to install Jenkins and Docker:
#!/bin/bash #install java sudo apt-get update -y sudo apt install fontconfig openjdk-17-jre -y #install jenkins sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null sudo apt-get update -y sudo apt-get install jenkins -y sudo systemctl start jenkins sudo systemctl status jenkins #install docker sudo apt-get update -y sudo apt install docker.io -y sudo systemctl start docker
Granting Permission to the Shell Script:
Provide execution permission to the shell script by running the command:
chmod +x <script_name>.sh
Check Docker and Jenkins Versions:
After installation, verify the versions of Docker and Jenkins installed on your system.
Task2:
Create IAM Users:
Log in to the AWS Management Console and go to IAM.
Click on "Users" in the left menu.
Click on "Add user" to create a new IAM user.
Enter a username for each user, such as IronOps, CaptainCloud, and DevOpsHulk.
Enable "Programmatic access" for each user and optionally allow "AWS Management Console access."
Assign Users to DevOps Groups:
Create a group named "DevOpsAvengers" in IAM.
Add the three IAM users to the "DevOpsAvengers" group.
Define IAM Policies for the DevOps Group:
Navigate to IAM and create a new policy specifying the actions the DevOps team can perform (e.g., managing EC2 instances, accessing S3 buckets).
Review and create the policy.
Attach Policies to the DevOps Group:
Go back to the "Groups" section in IAM and select "DevOpsAvengers" group.
Attach the policy created earlier to grant the DevOps team the necessary permissions.
By following these steps, you'll successfully set up an IAM user, launch a Linux instance, install Jenkins and Docker, and create a DevOps team of Avengers with the appropriate permissions.
Conclusion:
- Congratulations on completing these tasks and taking the first steps in your AWS journey! By mastering IAM and setting up a DevOps team with the appropriate permissions, you're well-equipped to tackle future challenges in the cloud environment. Remember, consistency and continuous learning are key to your success in DevOps.