From e33e489eeea8dea64feb8aed2c1eebb06e47407c Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 26 May 2017 08:38:01 -0400 Subject: [PATCH] Improve EC2 describe instances performance (#2766) Query the EC2 API for the instance ID rather than filter the results of all instances. --- builtin/credential/aws/path_login.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/builtin/credential/aws/path_login.go b/builtin/credential/aws/path_login.go index bf5089840..caffd320f 100644 --- a/builtin/credential/aws/path_login.go +++ b/builtin/credential/aws/path_login.go @@ -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 {