mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: Prevent crashing when deleting ecs_service which is gone
- fixes https://github.com/hashicorp/terraform/issues/3868
This commit is contained in:
parent
965e598437
commit
d9a5de7f7d
@ -247,6 +247,12 @@ func resourceAwsEcsServiceDelete(d *schema.ResourceData, meta interface{}) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(resp.Services) == 0 {
|
||||||
|
log.Printf("[DEBUG] ECS Service %q is already gone", d.Id())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] ECS service %s is currently %s", d.Id(), *resp.Services[0].Status)
|
log.Printf("[DEBUG] ECS service %s is currently %s", d.Id(), *resp.Services[0].Status)
|
||||||
|
|
||||||
if *resp.Services[0].Status == "INACTIVE" {
|
if *resp.Services[0].Status == "INACTIVE" {
|
||||||
|
Loading…
Reference in New Issue
Block a user