Day 38 Getting Started with AWS Basics☁

Day 38 Getting Started with AWS Basics☁

Congratulations!!!! you have come so far. Don't let your excuses break your consistency. Let's begin our new Journey with Cloud☁. By this time you have created multiple EC2 instances, if not let's begin the journey:

  • Amazon Web Services is one of the most popular Cloud Provider that has free tier too for students and Cloud enthusiastic for their Hands on while learning (Create your free account today to explore more on it).

  • Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. With IAM, you can manage permissions that which control AWS resources users can access. Using of IAM you can control who is authenticated (signed in) and authorized (having permissions) to use AWS resources.

  • Go to the IAM dashboard in the AWS Management Console.

  • Click on "Users" in the right side click on "Create user"

  • Choose a "username" of your choice and select "Provide user access to the "AWS Management Console" and select "I want to create an IAM user" and then "Custom password" and type your own password and click on "Next".

  • Now "Set permissions" dashboard will open on that select "Attach policies directly" and search for "AmazonEC2FullAccess" policy to this user to grant EC2 access then click on "Next" and again click on "Create user".

NOTE: Make sure to save the "Access Key ID" and "Secret Access Key" for later use.

Note: Copy your "Console sign-in URL" , "User name" , "Console password" in Notepad or click on "Download .csv file"

  • Before launching a instance we need to login to our IAM user account.

  • Copy your "Console sign-in URL" and past it on your "private window".

  • After that "Sign in as IAM user" dashboard will open in that we have to give our IAM "User name" and "Console password" which your copied in your notepad and click on "Sign in".

  • After that it will ask to change "old password " to "new password" change it to your requirement and click on *"*Confirm password " change.

  • After that your "console home page" will open in that search for "EC2" and launch a instance of "Ubuntu Linux".

  • Connect SSH to your local machine.

  • Create a file called jenkins-docker-installation.sh and past this script in your file.
#!/bin/bash

# Install Jenkins
sudo apt update
sudo apt install fontconfig openjdk-17-jre

sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian/jenkins.io-2023.key
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

# install docker
sudo apt update
sudo apt install docker.io -y
sudo apt install docker-compose -y

# status of jenkins and docker
sudo systemctl start docker
sudo systemctl enable docker
sudo systemctl status docker

sudo systemctl start jenkins
sudo systemctl enable jenkins
sudo systemctl status jenkins

  • Save the script, give it executable permissions, and execute it given below. This will install Jenkins and Docker on the instance.
chmod +x jenkins-docker-installation.sh && ./jenkins-docker-installation.sh

  • Checking status of docker and Jenkins.

  • This completes the process of creating an IAM user, launching an EC2 instance, and setting up Jenkins and Docker on that instance.

  • You can now access Jenkins through your EC2 instance's public IP or DNS name with port 8080 and start configuring your CI/CD pipeline.

  • Go to the IAM dashboard in the AWS Management Console.

  • Click on "Users" in the right side click on "Create user"

  • Choose a "username" of your choice and select "Provide user access to the AWS Management Console" and select "I want to create an IAM user" and then "Custom password" and type your own password and click on "Next".

  • Now "Set permissions" dashboard will open on that select "Attach policies directly" and then click on "Next" and again right bottom click on "Create user".

NOTE: Make sure to click on "Download .cvs file" save the "Access Key ID" and "Secret Access Key" for later use.

  • Again go to the IAM dashboard and click on "users" and then our "username group" there you will see "group" click on it.On the right side click on "Add user to groups"

  • Click on "Create group" and write "User group name" called "Avengers-DevOps-1" and give "Permissions policies" as "AmazonEC2FullAccess" and click on "Create user group".

    • Click on "Create group" and write "User group name" called "Avengers-DevOps-2" and give "Permissions policies" as "AmazonS3FullAccess" and click on "Create user group".
  • Click on "Create group" and write "User group name" called "Avengers-DevOps-3" and give "Permissions policies" as "AmazonRDSFullAccess" and click on "Create user group".

  • After all creating the 3 groups select the groups click on "Add users to group(s)". Now your groups is created in IAM.


Happy Learning

Thanks For Reading! :)

-DevOpsParthu💝💥