Create an AWS User using CLI2 Command at a specific Path

If you want to create a new user using AWS CLI2 at a specific path, you can do that using the create-user command with --path option.

Example:

dev@devs-MacBook-Air / % aws iam create-user \
--user-name Sammy \
--path /dept/it/python/

-------------------------------------------------------------------------
|                              CreateUser                               |
+-----------------------------------------------------------------------+
||                                User                                 ||
|+------------+--------------------------------------------------------+|
||  Arn       |  arn:aws:iam::XX1303XX01XX:user/dept/it/python/Sammy   ||
||  CreateDate|  2023-09-29T16:01:13+00:00                             ||
||  Path      |  /dept/it/python/                                      ||
||  UserId    |  AIDAVIH3DRXXBOWLLXXTG                                 ||
||  UserName  |  Sammy                                                 ||
|+------------+--------------------------------------------------------+|

AWS CLI 2 Create User at a PATH Command

Reference: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-user.html#options

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!