From 5de6687d9923caba4cb33fb69c380f868f56403e Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Thu, 15 Feb 2024 08:39:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=83=F0=9F=8F=BB=E2=80=8D=E2=99=82?= =?UTF-8?q?=EF=B8=8F=20faster=20aws=20connect=20and=20discovery=20(#3222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/aws/resources/discovery.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/aws/resources/discovery.go b/providers/aws/resources/discovery.go index e031ee345f..a3e2795aea 100644 --- a/providers/aws/resources/discovery.go +++ b/providers/aws/resources/discovery.go @@ -186,6 +186,11 @@ func Discover(runtime *plugin.Runtime, filters connection.DiscoveryFilters) (*in Assets: []*inventory.Asset{}, }} + if (conn.Conf == nil || len(conn.Conf.Discover.Targets) == 0) && conn.Asset() != nil { + in.Spec.Assets = append(in.Spec.Assets, conn.Asset()) + return in, nil + } + res, err := NewResource(runtime, "aws.account", map[string]*llx.RawData{"id": llx.StringData("aws.account/" + conn.AccountId())}) if err != nil { return nil, err