Skip to content

Commit

Permalink
Improve EC2 describe instances performance (#2766)
Browse files Browse the repository at this point in the history
Query the EC2 API for the instance ID rather than filter the results of
all instances.
  • Loading branch information
agy authored and vishalnayak committed May 26, 2017
1 parent 20eadd3 commit a6153bf
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions builtin/credential/aws/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a6153bf

Please sign in to comment.