Skip to content

Commit

Permalink
Remove filter in DescribeInstances (#10628)
Browse files Browse the repository at this point in the history
* Remove filter DescribeInstances

* Add changelog
  • Loading branch information
kaiyan-sheng authored Feb 8, 2019
1 parent 33cc59d commit 5fb40dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Update a few kibana.* fields to map to ECS. {pull}10350[10350]
- Update rabbitmq.* fields to map to ECS. {pull}10563[10563]
- Update haproxy.* fields to map to ECS. {pull}10558[10558] {pull}10568[10568]
- Collect all EC2 meta data from all instances in all states. {pull}10628[10628]

*Packetbeat*

Expand Down
11 changes: 1 addition & 10 deletions x-pack/metricbeat/module/aws/ec2/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"time"

awssdk "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch/cloudwatchiface"
"github.com/aws/aws-sdk-go-v2/service/ec2"
Expand Down Expand Up @@ -232,15 +231,7 @@ func getInstancesPerRegion(svc ec2iface.EC2API) (instanceIDs []string, instances
init := true
for init || output.NextToken != nil {
init = false
describeInstanceInput := &ec2.DescribeInstancesInput{
Filters: []ec2.Filter{
{
Name: awssdk.String("instance-state-name"),
Values: []string{"running"},
},
},
}

describeInstanceInput := &ec2.DescribeInstancesInput{}
req := svc.DescribeInstancesRequest(describeInstanceInput)
output, err := req.Send()
if err != nil {
Expand Down

0 comments on commit 5fb40dd

Please sign in to comment.