Automated user migration and management of AWS Identity and Access Management (IAM) resources

Anurag Chawla
3 min readApr 25, 2023

--

Here mission to migrate users in an automated way and manage AWS IAM (Identity and Access Management) resources.

Cloud Project — AWS Provider with Services and Technologies

Its based on real-world scenario, where there were more than 100 users that needed to be migrated and using a security best practise having Multi-factor authentication (MFA) enabled on their accounts.

Solution Architecture.

In order to avoid repetitive and manual tasks in the AWS console, I think its better to implement in an auomated way.

Using GitBash with AWS CLI and Shell Script — that helps to implement the process to migrate the users in efficient way.

In order to make this happen- follow the below Steps

1. Create a spreadsheet/csv file that contains the users information such as user along with user-group they belongs & password and save it in users.csv file.

sample — users.csv file

2. Log into AWS console, navigate to IAM Service and create user-group as defined in the csv files and provide the permission policies as desired for that group.

Navigate to IAM Service-Create User Group

Such as CloudAdmin having AdministratorAccess, IAMUserChangePassword.

IAM Service- User groups created along with Permissions policies

Simialry follow the same for other groups

DBA — having AmazonRDSFullAccess, IAMUserChangePassword

LinuxAdmin- having AmazonEC2FullAccess, IAMUserChangePassword

NetworkAdmin-having AmazonVPCFullAccess, IAMUserChangePassword

Trainees- having ReadOnlyAccess, IAMUserChangePassword

3.Run the Automation Script — in AWS Cloud Shell as below..that will create user, login-profile & add-user-to-group

Automation Script- create user, login-profile & add-user-to-group.

Navigate to IAM Service under Users —confirm users are created , along with Groups with respective policies permissions.

IAM services- Users created

Further one can create a custom policies for these users to enforce Multi-factor Authentication using Authenticator- as per the secuirty best practices.

--

--

Anurag Chawla

Emerging Technologies - Power Virtual Agents | AI Chatbots | Multi-Cloud & DevOps | UI Technologies - React , Angular | Gaming Technolgies - Unity, XR- AR/VR