Day 38: Getting Started with AWS Basics ☁
Day#38 Of 90 Days Of DevOps Challenge
🌟Introduction
Congratulations💥 on reaching Day 38 of your cloud journey!
It's incredible how far you've come, and today we're embarking on a new adventure into the world of Amazon Web Services (AWS).
Whether you're a student or a passionate cloud enthusiast, AWS offers a free tier that allows you to get hands-on experience while learning.
If you haven't already, I strongly recommend creating your free AWS account today to unlock the full potential of cloud computing.
Please check the blog to create a free tier AWS account.
💥AWS Overview
Amazon Web Services (AWS) is a groundbreaking and comprehensive cloud computing platform offered by Amazon.
With AWS, individuals and businesses gain access to an extensive range of cloud services that empower them to build and deploy applications, store and manage data, and run virtually any workload with unmatched flexibility, scalability, and reliability.
Key points about Amazon Web Services (AWS) based on the information provided here
Comprehensive Cloud Platform: AWS offers a comprehensive suite of cloud services and solutions, making it a robust cloud computing platform.
Ease of Deployment: AWS simplifies the deployment and management of cloud-based applications and resources.
Global Infrastructure: AWS operates a global network of data centers, ensuring that users worldwide have low-latency access to services and data.
Security and Compliance: AWS places a strong emphasis on security and compliance, providing a suite of security tools and compliance certifications to protect data and adhere to regulatory requirements.
Diverse Service Portfolio: AWS provides a broad spectrum of services, including computing, storage, databases, machine learning, analytics, and IoT, catering to various cloud computing needs.
Infrastructure as a Service (IaaS): AWS offers a range of IaaS components, such as:
Amazon EC2 (Elastic Compute Cloud): This service offers resizable compute capacity in the cloud, allowing users to launch virtual servers (EC2 instances) tailored to their needs.
Amazon Lightsail: A simplified compute service designed for developers, offering pre-configured instances with straightforward pricing.
Amazon VPC (Virtual Private Cloud): VPC enables users to create isolated network environments within AWS, providing control over network configuration and security.
Amazon EBS (Elastic Block Store): EBS offers scalable and high-performance block storage for use with EC2 instances, ensuring data persistence.
AWS Elastic Load Balancing: This service automatically distributes incoming application traffic across multiple EC2 instances, enhancing application availability and fault tolerance.
Amazon Route 53: A scalable domain name system (DNS) web service, Route 53 manages domain registration and routes internet traffic to resources like EC2 instances and S3 buckets.
Developer-Friendly: AWS offers developers a comprehensive ecosystem of tools, APIs, and services to streamline application development and deployment in the cloud.
Flexible Pricing Models: AWS provides various pricing models, including a free tier, to accommodate different usage scenarios.
Innovation Catalyst: AWS accelerates innovation by providing the infrastructure and services necessary for rapid prototyping and deployment of new ideas.
High Availability and Redundancy: AWS infrastructure is designed for high availability and redundancy, ensuring service continuity even in the event of hardware failures.
Scalability: AWS allows users to easily scale resources up or down to meet changing demands, optimizing resource utilization and cost-effectiveness.
Cost Management Tools: AWS equips users with tools to monitor, analyze, and optimize cloud spending, helping organizations maintain control over their cloud expenses.
Comprehensive Support and Documentation: AWS offers a range of support plans, including 24/7 customer support, extensive documentation, and an active user community to assist with cloud resource management.
Here are some typical scenarios where AWS is employed:
Web Application Hosting: AWS is frequently used to host web applications.
Big Data Processing: It's a go-to choice for handling large-scale big data tasks.
Scaling E-commerce Websites: During peak sales events, AWS is employed to seamlessly scale e-commerce websites.
Disaster Recovery: AWS can also serve as a disaster recovery location.
In summary, AWS offers a range of cloud computing services that enable you to easily adjust and expand your infrastructure based on your needs.
You only pay for the resources you use, which helps reduce the expenses and complexity associated with maintaining physical hardware and data centers.
⚓IAM - AWS Identity and Access Management
What is IAM?
AWS Identity and Access Management (IAM) is a critical service that empowers you to securely control access to your AWS resources.
With IAM, you can centrally manage permissions, determining who can access which AWS resources.
This granular control extends to both authentication (who is signed in) and authorization (who has permissions).
Want to dive deeper into IAM?
You can start your IAM journey here.
Now, let's move to the tasks of the day
📚Task 1: Building Your AWS Skills
Now, let's get hands-on with AWS👍
Your first task is to create an IAM user with a username of your choice and grant them access to EC2 instances.
After creating the user, launch a Linux instance through this IAM user.
Here's the exciting part: You're going to install Jenkins and Docker on your instance using a single Shell Script.
This exercise will familiarize you with user management, EC2 instances, and automated software installation.
Certainly! Here is a complete write-up as per the provided steps:
✔Step 1: Create IAM User
Log in to your AWS Management Console by visiting https://aws.amazon.com/ and clicking on the "Sign In to the Console" button.
Once logged in, search for the IAM (Identity and Access Management) Service in the AWS Management Console.
In the IAM dashboard, click on "Users" in the left navigation pane.
Click the "Create user" button to create a new IAM user.
Enter a username of your choice for the IAM user. Make sure to select "Programmatic access" as the access type since we'll be using this user for programmatic access to AWS services. Then click "Next" to proceed.
In the permissions section, select "Attach existing policies directly."
In the search box, type "AmazonEC2FullAccess" to find the policy, and then select it. This policy provides the necessary permissions to work with EC2 instances. Click "Next" to continue.
Review the user configuration to ensure it's correct, and then click "Create user."
After the user is created, make sure to note down the IAM user's access key ID and secret access key. These credentials will be required for authentication when launching EC2 instances.
Additionally, note down your AWS Account ID, which you can find in the AWS Management Console under "My Account" → "Account settings." You'll need this ID for various AWS operations.
✔Step 2: Launch EC2 Instance
Log in to the AWS Management Console with the IAM user credentials you just created
Click on the "Launch instance" button to create a new EC2 instance.
In the instance setup process:
Choose a Linux distribution, such as "Ubuntu," as your operating system.
Select an instance type. For example, choose "t2.micro" for a cost-effective option suitable for testing and small workloads.
Create a new key pair or use an existing one. If you create a new key pair, make sure to download the private key file (.pem). This key pair will be used to securely connect to your EC2 instance.
Click the "Launch Instance" button to create the EC2 instance.
Select the instance and click on connect. Select the Connect to instance with SSH client and copy the SSH link.
Go to the folder where you downloaded the .pem key pair file & open cmd
In the cmd paste the copied ssh url to connect remote server.
✔Step 3: Shell Script for Jenkins and Docker Installation
Create a shell script named docker_jenkins_install.sh
with the following content:
#!/bin/bash
#installing java
sudo apt update
java -version
sudo apt install default-jre
javac -version
#installing jenkins
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
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 update
sudo apt install jenkins
sudo systemctl start jenkins.service
sudo systemctl status jenkins
#installing docker
sudo apt-get update
sudo apt-get install docker.io -y
sudo systemctl start docker
sudo systemctl status docker
✔Step 4: Run the Shell Script
After creating the docker_jenkins_install.sh
script, you can run it on your EC2 instance to install Jenkins and Docker.
Make the script executable:
chmod +x docker_jenkins_install.sh
Run the script with superuser privileges:
sudo ./docker_jenkins_install.sh
The script will execute, installing Jenkins and Docker on your EC2 instance.
After the script completes, you can check the installed versions of Java , Docker & Jenkins using the following commands:
java -version docker --version jenkins --version
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.
📃Task 2: Assembling Your DevOps Team's Avengers
In the world of DevOps, collaboration is key.
Task 2 involves creating a DevOps team of "Avengers"
Your mission is to create three IAM users, each representing a member of your DevOps dream team (e.g., IronMan, Thor, Hawkeye).
Once you've assembled your squad, group them using IAM groups and apply an IAM policy that grants them the necessary permissions for DevOps tasks.
This task will deepen your understanding of IAM groups and policies.
✔Step 1: Create 3 IAM Users with Groups
Log in to your AWS Management Console.
Navigate to the IAM service.
Click on "Users" in the left navigation pane.
Click "Add user."
Enter the usernames of the IAM users.
Select "Programmatic access" and "AWS Management Console access" as access types.
Choose "Autogenerated password" or "Custom password" to set initial passwords.
Uncheck the "User must create a new password at next sign-in" option (if you set a custom password).
Choose "Add user to group" and Create the "DevOps" group
Search for and attach relevant policies to the group. For DevOps access, you might attach policies like "AmazonEC2FullAccess," "AmazonS3FullAccess," "AmazonRDSFullAccess," etc.
Review and create the group.
Now, Review and create the users.
Now, each user is associated with a specific DevOps group with the necessary IAM policies. You can add more users by clicking “create users” from Users
🌈Conclusion
As you continue to explore AWS, keep in mind that learning this platform is a valuable skill that can open doors to countless opportunities in cloud computing.
Stay curious, keep experimenting, and embrace the challenges that come your way.
Happy learning🎉 & may your cloud journey be filled with exciting discoveries!🎊
Thank you for joining us on this exciting Day 38 of the 90 Days of DevOps challenge. I hope you found the information helpful and insightful.
Stay tuned for Day 39 as we delve deeper into AWS and uncover more of its incredible capabilities.
So please keep yourself updated with my latest insights and articles on DevOps 🚀 by following me on :
Hashnode: vishaltoyou.hashcode.dev