providers/aws: if terminated, no longer exists

This commit is contained in:
Mitchell Hashimoto 2014-06-24 10:15:08 -07:00
parent 1d724f3481
commit 1df3297601
1 changed files with 6 additions and 0 deletions

View File

@ -89,6 +89,12 @@ func resource_aws_instance_refresh(
} }
instance := &resp.Reservations[0].Instances[0] instance := &resp.Reservations[0].Instances[0]
// If the instance is terminated, then it is gone
if instance.State.Name == "terminated" {
return nil, nil
}
return resource_aws_instance_update_state(s, instance) return resource_aws_instance_update_state(s, instance)
} }