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:
parent
435f1def27
commit
e33e489eee
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue