Skip to content

Commit

Permalink
check delete error
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 committed Sep 10, 2021
1 parent 1e0a0bc commit 817e881
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aws/resource_aws_sagemaker_endpoint_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_sagemaker_endpoint_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 817e881

Please sign in to comment.