kumar kittu
kumar kittu

Reputation: 87

Add multiple Groups to IAM User using AWS CLI command

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

Answers (1)

John Rotenstein
John Rotenstein

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

Related Questions