# Day 38 AWS and IAM Basics

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704910957626/8abc0356-bfe8-4a54-8341-f5403170c13c.png align="center")

By this time you have created multiple EC2 instances, and post installation manually installed applications like Jenkins, docker etc. Now let's switch to little automation part. Sounds interesting??🤯

## <mark>AWS:</mark>

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

Read from [here](https://aws.amazon.com/what-is-aws/)

## User Data in AWS:

* When you launch an instance in Amazon EC2, you have the option of passing user data to the instance that can be used to perform common automated configuration tasks and even run scripts after the instance starts. You can pass two types of user data to Amazon EC2: shell scripts and cloud-init directives.
    
* You can also pass this data into the launch instance wizard as plain text, as a file (this is useful for launching instances using the command line tools), or as base64-encoded text (for API calls).
    
* This will save time and manual effort everytime you launch an instance and want to install any application on it like apache, docker, Jenkins etc
    

## <mark>IAM:</mark>

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.

### Task1:

* Launch EC2 instance with already installed Jenkins on it. Once server shows up in console, hit the IP address in browser and you Jenkins page should be visible.
    

i have to login aws account then create a IAM user that will do create EC2 instance and install in jenkins.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705001574754/c9dd93ad-be7b-4f79-bad9-64e1d2a225ff.png align="center")

Here can seee that how to create a user and how to attach in file.

* Take screenshot of Userdata and Jenkins page, this will verify the task completion.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705001644867/77a1a054-13b1-43db-aa0f-52959cbee68f.png align="center")

Here cann see that how to create

### Task2:

Q.3 <mark>Read more on IAM Roles and explain the IAM Users, Groups and Roles in your own terms.</mark>

Certainly! Let's delve a bit deeper into AWS Identity and Access Management (IAM), focusing on IAM Users, Groups, and Roles:

1. **<mark>IAM Users:</mark>**
    
    * **Definition:** IAM Users are entities that represent individual people or services that interact with AWS resources. Each user has a unique set of security credentials (username and password or access keys) and permissions.
        
    * **Your Own Terms:** Think of IAM Users as individual accounts for people or applications in your AWS environment. Each user is given specific access rights based on their role or responsibilities. They might need different levels of permissions for different tasks.
        
2. **IAM Groups:**
    
    * **Definition:** IAM Groups are collections of IAM Users. By organizing users into groups, you can apply permissions to multiple users simultaneously.
        
    * **Your Own Terms:** Imagine IAM Groups as teams or departments within your AWS setup. Instead of assigning permissions to each user one by one, you create groups and assign permissions to the group. Users added to the group inherit those permissions automatically, simplifying access management.
        
3. **IAM Roles:**
    
    * **Definition:** IAM Roles are sets of permissions that define what actions an AWS service, IAM user, or other entities can perform. Roles don't have long-term credentials but are assumed temporarily by users, services, or resources.
        
    * **Your Own Terms:** Think of IAM Roles as "hats" that different entities can wear for specific tasks. For example, a role might grant temporary access to read from a specific S3 bucket. Roles are often used in scenarios where you want to give permissions across AWS accounts or allow AWS services to interact securely.
        

**How They Work Together:**

* You create IAM Users for specific individuals or services, granting them the necessary permissions.
    
* Users can be organized into IAM Groups based on their roles or responsibilities, making it easier to manage permissions for multiple users.
    
* IAM Roles are used to define granular permissions for various entities (users, services, etc.) and are assumed when needed, providing temporary access for specific actions.
    

**Key Concepts:**

* **Least Privilege Principle:** Users, groups, and roles should have the minimum permissions necessary to perform their tasks. This enhances security by limiting potential damage from accidental or intentional actions.
    
* **Multi-Factor Authentication (MFA):** For added security, IAM Users can be configured to use MFA, requiring an additional verification step (e.g., a code from a hardware token or mobile app) along with the password.
    

### <mark>Task2.2</mark>

Create three Roles named: DevOps-User, Test-User and Admin.

1 I have go to IAM roles and as per required to create Roles

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705002454586/b8ff92e5-3699-4c14-b24a-a4cafa619b80.png align="center")

here can see that how to create EC2 instance and how to create rrole in aws account.

*Thanks for read my blog if you liked it this blog please like and commend.*

*Contact me on* [***linkedin***](http://www.linkedin.com/in/pradeep-chitroliya-9347a9147)

*check out my GitHub for more resource* [***GitHub***](https://github.com/ChitrolyaPradeep)
