Skip to content

Commit

Permalink
Merge pull request 99designs#61 from tchia04/make_create_user_tags_op…
Browse files Browse the repository at this point in the history
…tional

Make create user tags optional
  • Loading branch information
Patrick Robinson authored Mar 28, 2019
2 parents d00e90f + 8d9c099 commit d67de18
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions iamy/awsdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,16 @@ func (a *awsSyncCmdGenerator) updateUsers() {

} else {
// Create user
a.cmds.Add("aws", "iam", "create-user",
"--user-name", toUser.Name,
"--path", path(toUser.Path),
"--tags", mapTagsToString(toUser.Tags))
if len(toUser.Tags) == 0 {
a.cmds.Add("aws", "iam", "create-user",
"--user-name", toUser.Name,
"--path", path(toUser.Path))
} else {
a.cmds.Add("aws", "iam", "create-user",
"--user-name", toUser.Name,
"--path", path(toUser.Path),
"--tags", mapTagsToString(toUser.Tags))
}

// add new groups
for _, g := range toUser.Groups {
Expand Down

0 comments on commit d67de18

Please sign in to comment.