Day 38 Task: Getting Started with AWS Basics ☁

Day 38 Task: Getting Started with AWS Basics ☁

·

3 min read

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:

  1. Log in to your AWS console and go to the IAM service.

  2. Click on the "Users" tab on the left sidebar and then click on the "Add user" button.

  3. On the "Permissions" page, select "Attach existing policies directly" and then search for "AmazonEC2FullAccess". Select this policy.

  4. Review the user details and click on "Create user".

    1. Note down the Access key ID and Secret access key for this user.

    2. 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

  1. Connect to the instance using SSH.

  2. 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
  1. Save the shell script file and make it executable by running the command chmod +x script.sh.

  2. Run the script using the command ./script.sh.

  3. 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:

  1. Log in to your AWS console and go to the IAM service.

  2. Click on the "Groups" tab on the left sidebar and then click on the "Create New Group" button.

  3. Choose a name for your DevOps group, such as "AvengersDevOps".

  4. 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".

  5. Click on "Create Group" to create the DevOps group.

  6. Click on the "Users" tab on the left sidebar and then click on the "Add user" button.

  7. Choose a username for the first IAM user, such as "IronMan".

  8. On the "Set Permissions" page, select "Add user to group" and choose the DevOps group you created in step 3.

  9. Click on "Next: Tags" and add any relevant tags.

  10. Click on "Create user" to create the first IAM user.

  11. Repeat steps to create two more IAM users for the Avengers team, such as "Thor" and "Hulk".

  12. 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 :)