From 29b67141eb84dde6e084868c1f0054572baa558b Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 13 Sep 2016 18:08:05 -0400 Subject: [PATCH] Only use running state for checking if instance is alive. (#1885) Fixes #1884 --- builtin/credential/aws-ec2/path_login.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/credential/aws-ec2/path_login.go b/builtin/credential/aws-ec2/path_login.go index 33b7c884e..9462c27a0 100644 --- a/builtin/credential/aws-ec2/path_login.go +++ b/builtin/credential/aws-ec2/path_login.go @@ -83,8 +83,7 @@ func (b *backend) validateInstance(s logical.Storage, instanceID, region string) if status.Reservations[0].Instances[0].State == nil { return nil, fmt.Errorf("instance state in instance description is nil") } - if *status.Reservations[0].Instances[0].State.Code != 16 || - *status.Reservations[0].Instances[0].State.Name != "running" { + if *status.Reservations[0].Instances[0].State.Name != "running" { return nil, fmt.Errorf("instance is not in 'running' state") } return status, nil