Skip to content

Commit

Permalink
fixes linter
Browse files Browse the repository at this point in the history
  • Loading branch information
coderGo93 committed Nov 17, 2021
1 parent e1f40db commit 345127f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/service/appstream/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta interfac

user, err := FindUserByUserNameAndAuthType(ctx, conn, userName, authType)

if err != nil {
return diag.FromErr(fmt.Errorf("error reading Appstream User (%s): %w", d.Id(), err))
}

if !d.IsNewResource() && user == nil {
log.Printf("[WARN] AppStream User (%s) not found, removing from state", d.Id())
d.SetId("")
Expand All @@ -167,6 +171,9 @@ func resourceUserUpdate(ctx context.Context, d *schema.ResourceData, meta interf
conn := meta.(*conns.AWSClient).AppStreamConn

userName, authType, err := DecodeUserID(d.Id())
if err != nil {
return diag.FromErr(fmt.Errorf("error decoding id AppStream User (%s): %w", d.Id(), err))
}

if d.HasChange("enabled") {
if d.Get("enabled").(bool) {
Expand Down

0 comments on commit 345127f

Please sign in to comment.