diff --git a/internal/sync.go b/internal/sync.go index 7df5fed..ce422c2 100644 --- a/internal/sync.go +++ b/internal/sync.go @@ -721,6 +721,7 @@ func DoSync(ctx context.Context, cfg *config.Config) error { googleClient, err := google.NewClient(ctx, cfg.GoogleAdmin, creds) if err != nil { + log.WithField("error", err).Warn("Problem establising a connection to Google directory") return err } @@ -731,6 +732,7 @@ func DoSync(ctx context.Context, cfg *config.Config) error { Token: cfg.SCIMAccessToken, }) if err != nil { + log.WithField("error", err).Warn("Problem establising a SCIM connection to AWS IAM Identity Center") return err } @@ -741,12 +743,24 @@ func DoSync(ctx context.Context, cfg *config.Config) error { }) if err != nil { + log.WithField("error", err).Warn("Problem establising a session for Identity Store") return err } // Initialize AWS Identity Store Public API Client with session identityStoreClient := identitystore.New(sess) + response, err := identityStoreClient.ListGroups( + &identitystore.ListGroupsInput{IdentityStoreId: &cfg.IdentityStoreID}) + + if err != nil { + log.WithField("error", err).Warn("Problem performing test query against Identity Store") + return err + } else { + log.WithField("Groups", response).Info("Test call for groups successful") + + } + // Initialize sync client with // 1. SCIM API client // 2. Google Directory API client