Skip to content

Commit

Permalink
Add autodiscover for aws_ec2 (elastic#14823)
Browse files Browse the repository at this point in the history
* Add autodiscover for aws_ec2
* Add aws.ec2.* to autodiscover template
  • Loading branch information
kaiyan-sheng authored and kvch committed Feb 20, 2020
1 parent 9a6fc07 commit 982e73d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x-pack/libbeat/autodiscover/providers/aws/ec2/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ import (
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/pkg/errors"

<<<<<<< HEAD
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/logp"
awsauto "github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/aws"
=======
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/logp"
awsauto "github.com/elastic/beats/x-pack/libbeat/autodiscover/providers/aws"
>>>>>>> Add autodiscover for aws_ec2 (#14823)
)

type ec2Instance struct {
Expand Down
5 changes: 5 additions & 0 deletions x-pack/libbeat/autodiscover/providers/aws/ec2/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ import (
"github.com/aws/aws-sdk-go-v2/service/ec2/ec2iface"
"go.uber.org/multierr"

<<<<<<< HEAD
"github.com/elastic/beats/v7/libbeat/logp"
awsauto "github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/aws"
=======
"github.com/elastic/beats/libbeat/logp"
awsauto "github.com/elastic/beats/x-pack/libbeat/autodiscover/providers/aws"
>>>>>>> Add autodiscover for aws_ec2 (#14823)
)

// fetcher is an interface that can fetch a list of ec2Instance objects without pagination being necessary.
Expand Down
11 changes: 11 additions & 0 deletions x-pack/libbeat/autodiscover/providers/aws/ec2/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/gofrs/uuid"
"github.com/pkg/errors"

<<<<<<< HEAD
"github.com/elastic/beats/v7/libbeat/autodiscover"
"github.com/elastic/beats/v7/libbeat/autodiscover/template"
"github.com/elastic/beats/v7/libbeat/common"
Expand All @@ -18,6 +19,16 @@ import (
"github.com/elastic/beats/v7/libbeat/logp"
awsauto "github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/aws"
awscommon "github.com/elastic/beats/v7/x-pack/libbeat/common/aws"
=======
"github.com/elastic/beats/libbeat/autodiscover"
"github.com/elastic/beats/libbeat/autodiscover/template"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/bus"
"github.com/elastic/beats/libbeat/common/cfgwarn"
"github.com/elastic/beats/libbeat/logp"
awsauto "github.com/elastic/beats/x-pack/libbeat/autodiscover/providers/aws"
awscommon "github.com/elastic/beats/x-pack/libbeat/common/aws"
>>>>>>> Add autodiscover for aws_ec2 (#14823)
)

func init() {
Expand Down
11 changes: 11 additions & 0 deletions x-pack/libbeat/autodiscover/providers/aws/ec2/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,27 @@ import (
"testing"
"time"

<<<<<<< HEAD
=======
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/bus"
"github.com/elastic/beats/libbeat/logp"
awsauto "github.com/elastic/beats/x-pack/libbeat/autodiscover/providers/aws"
"github.com/elastic/beats/x-pack/libbeat/autodiscover/providers/aws/test"
>>>>>>> Add autodiscover for aws_ec2 (#14823)
"github.com/gofrs/uuid"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
<<<<<<< HEAD

"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common/bus"
"github.com/elastic/beats/v7/libbeat/logp"
awsauto "github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/aws"
"github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/aws/test"
=======
>>>>>>> Add autodiscover for aws_ec2 (#14823)
)

func Test_internalBuilder(t *testing.T) {
Expand Down
5 changes: 5 additions & 0 deletions x-pack/libbeat/autodiscover/providers/aws/ec2/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ import (

"github.com/pkg/errors"

<<<<<<< HEAD
"github.com/elastic/beats/v7/libbeat/logp"
awsauto "github.com/elastic/beats/v7/x-pack/libbeat/autodiscover/providers/aws"
=======
"github.com/elastic/beats/libbeat/logp"
awsauto "github.com/elastic/beats/x-pack/libbeat/autodiscover/providers/aws"
>>>>>>> Add autodiscover for aws_ec2 (#14823)
)

type watcher struct {
Expand Down

0 comments on commit 982e73d

Please sign in to comment.