From 982e73d743fdcde1cb10ae2cdda4c71fd6cc2370 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Thu, 6 Feb 2020 15:20:16 -0700 Subject: [PATCH] Add autodiscover for aws_ec2 (#14823) * Add autodiscover for aws_ec2 * Add aws.ec2.* to autodiscover template --- x-pack/libbeat/autodiscover/providers/aws/ec2/ec2.go | 6 ++++++ .../libbeat/autodiscover/providers/aws/ec2/fetch.go | 5 +++++ .../autodiscover/providers/aws/ec2/provider.go | 11 +++++++++++ .../autodiscover/providers/aws/ec2/provider_test.go | 11 +++++++++++ .../libbeat/autodiscover/providers/aws/ec2/watch.go | 5 +++++ 5 files changed, 38 insertions(+) diff --git a/x-pack/libbeat/autodiscover/providers/aws/ec2/ec2.go b/x-pack/libbeat/autodiscover/providers/aws/ec2/ec2.go index fb5268547f3f..1275ecae709f 100644 --- a/x-pack/libbeat/autodiscover/providers/aws/ec2/ec2.go +++ b/x-pack/libbeat/autodiscover/providers/aws/ec2/ec2.go @@ -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 { diff --git a/x-pack/libbeat/autodiscover/providers/aws/ec2/fetch.go b/x-pack/libbeat/autodiscover/providers/aws/ec2/fetch.go index d25b6105fd99..c7824854c464 100644 --- a/x-pack/libbeat/autodiscover/providers/aws/ec2/fetch.go +++ b/x-pack/libbeat/autodiscover/providers/aws/ec2/fetch.go @@ -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. diff --git a/x-pack/libbeat/autodiscover/providers/aws/ec2/provider.go b/x-pack/libbeat/autodiscover/providers/aws/ec2/provider.go index 3af1a736778d..39f6e8dbeb89 100644 --- a/x-pack/libbeat/autodiscover/providers/aws/ec2/provider.go +++ b/x-pack/libbeat/autodiscover/providers/aws/ec2/provider.go @@ -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" @@ -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() { diff --git a/x-pack/libbeat/autodiscover/providers/aws/ec2/provider_test.go b/x-pack/libbeat/autodiscover/providers/aws/ec2/provider_test.go index 3dd1152d40d8..8c7d132ff080 100644 --- a/x-pack/libbeat/autodiscover/providers/aws/ec2/provider_test.go +++ b/x-pack/libbeat/autodiscover/providers/aws/ec2/provider_test.go @@ -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) { diff --git a/x-pack/libbeat/autodiscover/providers/aws/ec2/watch.go b/x-pack/libbeat/autodiscover/providers/aws/ec2/watch.go index f3af85f5bc2f..50c8a158add9 100644 --- a/x-pack/libbeat/autodiscover/providers/aws/ec2/watch.go +++ b/x-pack/libbeat/autodiscover/providers/aws/ec2/watch.go @@ -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 {