AWS IAM (Identity and Access Management)
Tags: aws
Published: 2023-09-19 14:23:58

▶️ Service restrictions: It's a global service. So, anyone can use it.
▶️ Motivation: To create users/groups with specific access but not the whole access.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkou5b5z88t9k5rimayc.png)


This is how the permission is given(Using json or using UI/UX):

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/25ahe5e3650oj5a42iqy.png)

Let's create users for our account:

Firstly, go to the IAM and then go to users:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ohfi6ha1srlcctmlpyi.png)

Then press create user

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mj0ti1190hj4jd9rd6em.png)

Give a name for the user 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mn4ym3htmip1e24cyypy.png)
Then press next

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1mkxduc5czklzqo48epc.png)
Attach existing policies
Select your desired permissions:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ga2lcxhrsfi5nl2l2h8f.png)
Press next
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luuejx0v28cx6i2eojkt.png)
Press create user and you are done!


**IAM Policies structure**
It's the structure using json code to give certain permission and access

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wc4yzv4fuy8m5dwd5rhn.png)

**AWS Access keys**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8hpymsjw4cdi08ghw37k.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gqa7q7fe5k4l4kmm5wz.png)
Example of an access key

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qa7mpz5b9puiby5mjxls.png)


Tools to access your AWS account:
- AWS CLI:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpth3wxb6fn3tcmn171i.png)

Use [this link ](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)to install



It will look like this

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l8iakjc3egh151qmn35o.png)
Go to your command prompt and then write this command to see this output

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sd79yn1ouuwssjln7ly5.png)

Create and access key :

Go to your IAM user and press security credentials and press create access key
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvgaf21i0sg8tobtlwic.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ogf2k3xo5rtjenkcuetm.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2stsdlhuxtqv08642np9.png)

Done!

Now go to your local CLI and give these credentials:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9winizq2xfrmscxjcczw.png)

Check the IAM users:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lb57m0dzlu2hn8cdnwud.png)

You can also verify after logging into the "admin-aws" account that it has this user only:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ppsqny9y8uz7w5k6z25j.png)

Note: This view is seen once you logged into the IAM user account you created and used the IAM security credentials off


- AWS Cloudshell
You can also use this to get the same features as the AWS CLI.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp1ee4u15tnbgwyiptbw.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m24d42ejcnbldnygjmkg.png)



- AWS SDK:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qfao7jmetem7wj3ratv.png)


To ensure the security or logs of IAM User accounts, go to access advisor:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aha380dtm1gvi56gzwar.png)
You can see what tools has been used.

Also, to get all of the user info for an account[root or main account], go to IAM--> Credential report and then download the report


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ecu1ogyp52xxn8pefxe.png)


**Shared Responsibility**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm2cb01wpo0ws89givxc.png)


That's it!!
<img src="https://media0.giphy.com/media/Nfs5y1kzJKfu/giphy.gif?cid=ecf05e472d3w835ptrri5m1p6ifnwl9mi7ope9pifvhpcxf6&rid=giphy.gif&ct=g">