Table of contents
AWS:
AWS Meaning: The Amazon Web Services (AWS) platform provides more than 200 fully featured services from data centers located all over the world, and is the world's most comprehensive cloud platform. Amazon web service is an online platform that provides scalable and cost-effective cloud computing solutions.
IAM:
IAM provides fine-grained access control across all of AWS. With IAM, you can control access to services and resources under specific conditions. Use IAM policies to manage permissions for your workforce and systems to ensure least privilege.
Task1:
Create an IAM user with username of your own wish 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 single Shell Script.
Here are the steps you can follow:
Log in to your AWS console and go to the IAM service.
Click on the "Users" tab on the left sidebar and then click on the "Add user" button.
On the "Permissions" page, select "Attach existing policies directly" and then search for "AmazonEC2FullAccess". Select this policy.
Review the user details and click on "Create user".
Note down the Access key ID and Secret access key for this user.
Launch a new Linux instance in your AWS account and make sure to select the IAM user you just created as the user data.
- Loging as IAM user and change the Password
Connect to the instance using SSH.
Create a new shell script file and add the following commands to it:
#!/bin/bash
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install -y jenkins
sudo systemctl start jenkins
sudo systemctl enable jenkins
sudo apt-get install -y docker.io
sudo usermod -aG docker jenkins
sudo systemctl start docker
sudo systemctl enable docker
Save the shell script file and make it executable by running the command
chmod +x
script.sh
.Run the script using the command
./
script.sh
.After the script completes successfully, Jenkins and Docker should be installed on your Linux instance.
Task2:
In this task you need to prepare a devops team of avengers. Create 3 IAM users of avengers and assign them in devops groups with IAM policy.
Here are the steps you can follow:
Log in to your AWS console and go to the IAM service.
Click on the "Groups" tab on the left sidebar and then click on the "Create New Group" button.
Choose a name for your DevOps group, such as "AvengersDevOps".
On the "Attach Policy" page, search for and select the policies you want to assign to the group. For a DevOps group, you may want to include policies such as "AmazonEC2FullAccess", "AmazonECS_FullAccess", "AmazonS3FullAccess", and "AWSLambda_FullAccess".
Click on "Create Group" to create the DevOps group.
Click on the "Users" tab on the left sidebar and then click on the "Add user" button.
Choose a username for the first IAM user, such as "IronMan".
On the "Set Permissions" page, select "Add user to group" and choose the DevOps group you created in step 3.
Click on "Next: Tags" and add any relevant tags.
Click on "Create user" to create the first IAM user.
Repeat steps to create two more IAM users for the Avengers team, such as "Thor" and "Hulk".
Once all three users have been created and added to the DevOps group, they should have the necessary IAM policies to perform DevOps tasks on AWS.
Post your progress on Linkedin. Till then Happy Learning :)