Day 38: 90DaysOfChallenge

Day 38: 90DaysOfChallenge

Getting Started with AWS Basics☁

AWS

AWS (Amazon Web Services) is a comprehensive, most popular cloud computing platform provided by Amazon. It includes a mixture of infrastructure-as-a-service (IaaS), platform-as-a-service (PaaS) and packaged software-as-a-service (SaaS) offerings. AWS offers tools such as compute power, database storage and content delivery services.

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.

Task 01:

Create an IAM user with username of your own wish and grant EC2 Access.

  1. Login to your AWS Management Console using your username and password.

  2. Search IAM from the top search bar and click on IAM.

  3. The below screen opens up. Click on User from the left side bar.

  4. Click on Create User as below -

  5. Provide Username and click on the checkbox to access AWS Management Console.

  6. Provide the password and click on Next.

  7. The Group Permission Page opens up. Select Attach policies directly box and search "AmazonEC2FullAccess" and click on Next.

  8. Review the details and click on Create User.

  9. Once, the user is created below screen opens up. Click on "Download .csv file" which is the user's password to save it for future use.

  10. A .csv file gets downloaded which provides the Console Sign In URL and the user password.

  11. Open the downloaded file and launch the Sign In URL. The IAM SignIn Page opens up. Enter the IAM username and password and click on Sign In.

    Launch your Linux instance through the IAM user that you created now and install Jenkins and docker on your machine via single Shell Script.

    1. The Below Screen opens up with the username displayed at the top right corner of the screen.

  1. Click on EC2 icon on the screen shown above and click on Launch an Instance from EC2 dashboard to create an EC2 instance. Provide the Name of the EC2 instance.

  1. Select Ubuntu as the Amazon Machine Image.

  1. Select Instance Type as t2.micro and select the key pair value from the one stored in your local.

  1. Select the required security group and click on Launch Instance. You can see the EC2 instance is up and running.

  1. Click on the Instance ID and click on connect

  1. Click on SSH Client and launch the Instance in your terminal.

  1. EC2 instance is launched successfully.

  1. Enter the below code to launch Jenkins -

Installation of Jenkins

Jenkins requires Java in order to run. There are multiple Java implementations that you can use. OpenJDK is the most popular one.

Update the Debian apt repositories, install OpenJDK 17, and check the installation with the below commands:

    sudo apt update
    sudo apt install fontconfig openjdk-17-jre
    java -version
    openjdk version "17.0.8" 2023-07-18
    OpenJDK Runtime Environment (build 17.0.8+7-Debian-1deb12u1)
    OpenJDK 64-Bit Server VM (build 17.0.8+7-Debian-1deb12u1, mixed mode, sharing)

Use the below command to install Jenkins from debian-stable apt repository:

    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
    sudo apt-get install jenkins
  1. Enter the below code to launch Docker -
sudo apt-get update
sudo apt install docker.io
  1. Use the below command to check Jenkins and Docker is installed or not -

    jenkins --version
    docker --version
    

    Jenkins and Docker is installed successfully in the machine through IAM User.

Task 02:

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.

  1. Go back to your admin Console and create 3 IAM users of avengers the same way as we created above.

  1. Now, click on Users Group present on left side of the bar and click on Create Group.

3. Provide the Group Name.

4. Attach the following Permission Policies - "AmazonEC2FullAccess", "AmazonS3FullAccess", and "AmazonRDSFullAccess" policies and click on Create Group.

5. Devops-avengers group is created.

  1. Now, add the avenger users in devops-avengers group. Click on the devops-avengers hyperlink and click on Add users to add the users.

  1. Select all the three users to add them in the group and click on Add users button present in the bottom.

  1. We can see the three avenger users are added to devops-avengers group.

We have understood the concept of Users, Group and Permissions from the above task by creating users, allocating permissions to the users and adding them to the groups.

Thanks for reading!

Happy learning!