AWS:
Amazon Web Services is one of the most popular Cloud Providers that have a free tier for students and Cloud enthusiasts for their Hands-on while learning (Create your free account today to explore more on it).
IAM:
AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. With IAM, you can centrally manage permissions that control which AWS resources users can access. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.
Task1:
- Create an IAM user with the username and grant EC2 Access. Launch your Linux instance through the IAM user that you created now and install Jenkins and Docker on your machine via a single Shell Script.
Go to IAM Console and create a new user
Give a name to the user and password
- Give AmazonEC2FullAccess policy permission
- Create the user
- Log in to a new console with a new user -
- Once you're logged in, you'll be able to see new user on the top right hand side -
Now, let's create a new EC2 instance with Jenkins and Docker installed. Go to Ec2 and select - Launch new instance.
Select the general settings and write the below bash script in user data to get the servers launched with pre-installed docker and Jenkins.
#!/bin/bash
#System update
sudo apt update
#Java installation
sudo apt install openjdk-17-jre -y
#Jenkins ----
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins -y
#Docker ----
sudo apt install docker -y
Verify by logging into the server -
Added permission EC2InstanceConnect as I was not able to connect to Instance connect with new user -
Verify the docker and Jenkins using systemctl command -
sudo systemctl status docker | grep running
sudo systemctl status jenkins | grep running
Task2:
- In this task, you need to prepare a DevOps team of Avengers. Create 3 IAM users of Avengers and assign them to DevOps groups with the IAM policy.
- Go to IAM Console and create 3 new users - Stark, Strange, and Hulk
- Create a new user group named Avengers and add all three user with IAMFullAccess permission -
As we are done, clean up all instances and users/groups.
Hope you enjoyed the learning :)
Thank you :)