AWS
Amazon Web Services is one of the most popular Cloud Providers that has a free tier for students and Cloud enthusiasts for their Hands-on while learning (Create your free account today to explore more on it).
Read from here
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. Read from here
To get to know IAM more deeply Click Here!!
Step 1: Create an IAM User with EC2 Access
Log in to the AWS Management Console.
Go to the IAM service.
In the left sidebar, select "Users" and then click the "Createuser" button.
Choose a username (e.g., "demo-user") and select the "Programmatic access" checkbox.
Attach the "AmazonEC2FullAccess" policy to this user, which grants access to EC2 resources.
Complete the user creation process, and make sure to note the access key and secret key.
Download.csv file
Step 2: Launch an EC2 Instance Using the IAM User
Login again using IAM user. (you will get those 12 digits from the download .csv file)
Now we can see, we have logged into our IAM user account (Zoom in and see at the top right corner)
Launch an EC2 instance with your preferred Linux distribution (e.g., Amazon Linux or Ubuntu).
Search for EC2 in your IAM account
Click on Launch instance
Fill in the required fields and launch the instance
we can see our instance is running
Step 3: SSH into the EC2 Instance
Once the EC2 instance is running, SSH into it using the key pair associated with the instance.
copy your public IP
Open your terminal and connect with the instance
sudo ssh -i <your-pem-key> ubuntu@<your-public-ip>
Step 4: Install Jenkins and Docker via Shell Script
Make the script executable:
chmod +x jenkins-docker.sh
Check their versions
Create IAM Users:
In the AWS Management Console, go to IAM.
In the left sidebar, select "Users" and click "Add user."
Create three IAM users with names like "avenger-devops-1," "avenger-devops-2," and "avenger-devops-3." Enable programmatic access for each user.
Create a Group:
In IAM, select "Groups" in the left sidebar and click "Create group."
Name the group (e.g., "DevOpsAvengers").
Attach policies to the group that grants DevOps-related permissions. You can use AWS-managed policies or create a custom policy. And click on create group
The group is created successfully
Add Users to the Group:
Click the group name-->Add users
Select the users to add to the group-->Add users
we can see the users in this group
Thank you so much for reading
Follow me on LinkedIn to see interesting posts like this : )