Improve EC2 describe instances performance (#2766)

Query the EC2 API for the instance ID rather than filter the results of
all instances.
This commit is contained in:
Andrew 2017-05-26 08:38:01 -04:00 committed by Vishal Nayak
parent 435f1def27
commit e33e489eee

View file

@ -170,13 +170,8 @@ func (b *backend) validateInstance(s logical.Storage, instanceID, region, accoun
}
status, err := ec2Client.DescribeInstances(&ec2.DescribeInstancesInput{
Filters: []*ec2.Filter{
&ec2.Filter{
Name: aws.String("instance-id"),
Values: []*string{
aws.String(instanceID),
},
},
InstanceIds: []*string{
aws.String(instanceID),
},
})
if err != nil {