Reputation: 87
This command works fine with one group:
aws iam add-user-to-group --user-name user1 --group-name group1
Now need to add multiple groups to user while creating like:
aws iam add-user-to-group --user-name user1 --group-name group1 group2
How could this achieved?
Upvotes: 1
Views: 560
Reputation: 269091
The add-user-to-group
command only allows one group to be added to a user at a time.
You would either need to call that command multiple times, or you could write code using an AWS SDK and add your own logic to add multiple groups.
Upvotes: 2