provider/aws: fix ECS service CheckDestroy in tests
This commit is contained in:
parent
f473c2a6d4
commit
47f8b0cd79
|
@ -6,6 +6,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/service/ecs"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
|
@ -210,6 +211,10 @@ func testAccCheckAWSEcsServiceDestroy(s *terraform.State) error {
|
|||
Services: []*string{aws.String(rs.Primary.ID)},
|
||||
})
|
||||
|
||||
if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ClusterNotFoundException" {
|
||||
continue
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
if len(out.Services) > 0 {
|
||||
return fmt.Errorf("ECS service still exists:\n%#v", out.Services)
|
||||
|
|
Loading…
Reference in New Issue