Skip to content

Commit

Permalink
aws/resources: Befor importing 'aws_iam_user_group_membership' check …
Browse files Browse the repository at this point in the history
…grups names

If there is no groups we cannot import this resources so we should skip it
  • Loading branch information
xescugc committed May 29, 2020
1 parent 86d8875 commit f8d6c64
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,12 @@ func iamUserGroupMemberships(ctx context.Context, a *aws, resourceType string, f
return nil, err
}

// If the user has no Groups then we do not need to proceed
// or TF will return an error of malformed ID
if len(groupNames) == 0 {
return nil, nil
}

resources := make([]provider.Resource, 0)
for _, un := range userNames {
// The format expected by TF is <user-name>/<group-name1>/...
Expand Down

0 comments on commit f8d6c64

Please sign in to comment.