diff --git a/aws/resource_aws_sagemaker_endpoint_configuration.go b/aws/resource_aws_sagemaker_endpoint_configuration.go index bf4650bcb00..3164f91256b 100644 --- a/aws/resource_aws_sagemaker_endpoint_configuration.go +++ b/aws/resource_aws_sagemaker_endpoint_configuration.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -391,7 +392,7 @@ func resourceAwsSagemakerEndpointConfigurationDelete(d *schema.ResourceData, met _, err := conn.DeleteEndpointConfig(deleteOpts) - if isAWSErr(err, sagemaker.ErrCodeResourceNotFound, "") { + if tfawserr.ErrMessageContains(err, "ValidationException", "Could not find endpoint configuration") { return nil } diff --git a/aws/resource_aws_sagemaker_endpoint_configuration_test.go b/aws/resource_aws_sagemaker_endpoint_configuration_test.go index 4903570dc72..d91f897aff8 100644 --- a/aws/resource_aws_sagemaker_endpoint_configuration_test.go +++ b/aws/resource_aws_sagemaker_endpoint_configuration_test.go @@ -271,6 +271,7 @@ func TestAccAWSSagemakerEndpointConfiguration_disappears(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckSagemakerEndpointConfigurationExists(resourceName), testAccCheckResourceDisappears(testAccProvider, resourceAwsSagemakerEndpointConfiguration(), resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsSagemakerEndpointConfiguration(), resourceName), ), ExpectNonEmptyPlan: true, },