AWS IAM WorkItems
-
Create an IAM user with programmatic access and administrator Access and configure the user in the AWS CLI
-
Now lets try to create 2 users using AWS CLI Refer Here
aws iam create-user --user-name ironman
aws iam create-user --user-name thor
- Now lets create a group called as DBAdmins
aws iam create-group --group-name dbadmins
- Now lets attach a Policy
AmazonRDSFullAccessto the group
aws iam attach-group-policy --group-name dbadmins --policy-arn 'arn:aws:iam::aws:policy/AmazonRDSFullAccess'
- Now lets add users to the group
aws iam add-user-to-group --group-name dbadmins --user-name ironman
aws iam add-user-to-group --group-name dbadmins --user-name thor
- Now lets try to create access key for the user
aws iam create-access-key --user-name ironman > ironman.json
aws iam create-access-key --user-name thor > thor.json
- Rotating IAM Credentials

- Now delete the old access key

- Exercise:
- Write a shell script to rotate credentials for all iam user except "admin"
- Note: to get the list of user
aws iam list-users --query "Users[*].UserName"
