diff --git a/.changelog/17251.txt b/.changelog/17251.txt index e0dbdd889e3a..ef2174223bc1 100644 --- a/.changelog/17251.txt +++ b/.changelog/17251.txt @@ -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. ``` \ No newline at end of file diff --git a/aws/resource_aws_sagemaker_user_profile.go b/aws/resource_aws_sagemaker_user_profile.go index e1b1558a997b..39d1690fc3e1 100644 --- a/aws/resource_aws_sagemaker_user_profile.go +++ b/aws/resource_aws_sagemaker_user_profile.go @@ -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{})), } @@ -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") {