Skip to content

Commit

Permalink
Merge pull request #9241 from terraform-providers/rfd-retry-user
Browse files Browse the repository at this point in the history
final retry when waiting for transfer user deletion
  • Loading branch information
ryndaniels authored Jul 8, 2019
2 parents 28179a8 + 62dfb3e commit 8e0ea80
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion aws/resource_aws_transfer_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func waitForTransferUserDeletion(conn *transfer.Transfer, serverID, userName str
UserName: aws.String(userName),
}

return resource.Retry(10*time.Minute, func() *resource.RetryError {
err := resource.Retry(10*time.Minute, func() *resource.RetryError {
_, err := conn.DescribeUser(params)

if isAWSErr(err, transfer.ErrCodeResourceNotFoundException, "") {
Expand All @@ -244,4 +244,15 @@ func waitForTransferUserDeletion(conn *transfer.Transfer, serverID, userName str

return resource.RetryableError(fmt.Errorf("Transfer User (%s) for Server (%s) still exists", userName, serverID))
})

if isResourceTimeoutError(err) {
_, err = conn.DescribeUser(params)
}
if isAWSErr(err, transfer.ErrCodeResourceNotFoundException, "") {
return nil
}
if err != nil {
return fmt.Errorf("Error decoding transfer user ID: %s", err)
}
return nil
}

0 comments on commit 8e0ea80

Please sign in to comment.