Skip to content

Commit

Permalink
wait for user profile update to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 committed Feb 25, 2021
1 parent ddf76f9 commit 36dfddc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .changelog/17251.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ resource/aws_sagemaker_domain: Make `default_resource_spec` optional for the `te

```release-note:bug
resource/aws_sagemaker_domain: Wait for update to finish.
```

```release-note:bug
resource/aws_sagemaker_user_profile: Wait for update to finish.
```
11 changes: 9 additions & 2 deletions aws/resource_aws_sagemaker_user_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,12 @@ func resourceAwsSagemakerUserProfileUpdate(d *schema.ResourceData, meta interfac
conn := meta.(*AWSClient).sagemakerconn

if d.HasChange("user_settings") {
domainID := d.Get("domain_id").(string)
userProfileName := d.Get("user_profile_name").(string)

input := &sagemaker.UpdateUserProfileInput{
UserProfileName: aws.String(d.Get("user_profile_name").(string)),
DomainId: aws.String(d.Get("domain_id").(string)),
UserProfileName: aws.String(userProfileName),
DomainId: aws.String(domainID),
UserSettings: expandSagemakerDomainDefaultUserSettings(d.Get("user_settings").([]interface{})),
}

Expand All @@ -321,6 +324,10 @@ func resourceAwsSagemakerUserProfileUpdate(d *schema.ResourceData, meta interfac
if err != nil {
return fmt.Errorf("error updating SageMaker User Profile: %w", err)
}

if _, err := waiter.UserProfileInService(conn, domainID, userProfileName); err != nil {
return fmt.Errorf("error waiting for SageMaker User Profile (%s) to update: %w", d.Id(), err)
}
}

if d.HasChange("tags") {
Expand Down

0 comments on commit 36dfddc

Please sign in to comment.