diff --git a/providers/aws/resources/discovery.go b/providers/aws/resources/discovery.go index a3e2795aea..e031ee345f 100644 --- a/providers/aws/resources/discovery.go +++ b/providers/aws/resources/discovery.go @@ -186,11 +186,6 @@ 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 diff --git a/providers/aws/resources/discovery_conversion.go b/providers/aws/resources/discovery_conversion.go index 4de1fd99a1..95f0f1cf93 100644 --- a/providers/aws/resources/discovery_conversion.go +++ b/providers/aws/resources/discovery_conversion.go @@ -204,7 +204,7 @@ func accountAsset(conn *connection.AwsConnection, awsAccount *mqlAwsAccount) *in PlatformIds: []string{id}, Name: name, Platform: connection.GetPlatformForObject(""), - Connections: []*inventory.Config{conn.Conf}, + Connections: []*inventory.Config{conn.Conf.Clone(inventory.WithoutDiscovery(), inventory.WithParentConnectionId(conn.Conf.Id))}, Options: conn.ConnectionOptions(), } }