This script will list all the IAM user and then users will select IAM users which needs to be disabled from accessing the AWS management console. Users can type in bulk IAM users or one user. If then that users will try to access AWS console for that particular user it will not be able to do so. These users if have access key and secret key then they have the option of accessing them in programmatic way by entering access key and secret key.
For listing use -l
For any help or to know more about it use -h
- Run the script . It will list the IAM users.
- Type the IAM user name which needs to be disable.One can write one user or more than one sepearted by space.In given description one user is disabled.
- As it can be seen that both users are disabled. If we check on the dashboard to verify it will show disable for both of the users.
For muskan user-
For mj user-
- Now it will ask for programmatic access to that user if it have access key and secret key then go ahead otherwise type no.
If a user has access key and secret key then it can have programmatic access. The program will ask for the same , if it is yes then enter the access key and secret key ,if no it will exit and other than that will give an error of wrong choice.
For yes it will look like
For no-
For other-