From 7c38b198b251154c0b7b2f20470adfaa5cb38a2d Mon Sep 17 00:00:00 2001 From: Ronaldo Date: Sat, 8 Sep 2018 22:18:24 +0100 Subject: [PATCH] Fix missing state error sagemaker (#1) * Update sagemaker_endpoint_configuration not found message when reading resources * Update sagemaker_endpoint error when resource is NotFound * Fix ResourceNotFound to ValidationException --- aws/resource_aws_sagemaker_endpoint.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sagemaker_endpoint.go b/aws/resource_aws_sagemaker_endpoint.go index 6e2b4b2c289..b9bb2bdc3e7 100644 --- a/aws/resource_aws_sagemaker_endpoint.go +++ b/aws/resource_aws_sagemaker_endpoint.go @@ -103,6 +103,10 @@ func resourceAwsSagemakerEndpointRead(d *schema.ResourceData, meta interface{}) endpointRaw, _, err := SagemakerEndpointStateRefreshFunc(conn, d.Id())() if err != nil { + if sagemakerErr, ok := err.(awserr.Error); ok && sagemakerErr.Code() == "ValidationException" { + d.SetId("") + return nil + } return err } if endpointRaw == nil {