Wednesday, 15 January 2020

AWS CLI - Add user to a group


To get the list of groups : aws iam list-groups

aws iam list-groups 
"Groups" : 
"path : 
"GroupName": "Groupte 
"GroupId"• ' 
"Arn": "arn 
"CreateDate • " 
: group/Grouptest" ,

To Add user to a group: aws iam add-user-to-group --group-name 'Grouptest'  --user-name 'testuser2'

S aws iam add-user-to-group 
--group-name 'Grouptest' 
--user-name 
' testuser2'

Verify the user to the group : aws iam list-groups-for-user --user-name 'testuser2'

aws iam list-groups-for-user 
"Groups" : 
"path . 
"GroupId"• ' 
"Arn": " 
"CreateDate • " 
--user-name 
"GroupName": "Grouptest" , 
' testuser2' 
: group/Grouptest" , 
". 2020-01-0 T18: 28:16Z"


No comments: