From 9e939d8ba79b6bd2109d71639e35c82c2eb409f7 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Mon, 12 Feb 2024 13:49:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20aws=20cloudtrail=20init=20?= =?UTF-8?q?function=20when=20no=20args=20where=20provided=20(#3268)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/aws/resources/aws_cloudtrail.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/aws/resources/aws_cloudtrail.go b/providers/aws/resources/aws_cloudtrail.go index 6b87484ccc..ea3ca4bf0a 100644 --- a/providers/aws/resources/aws_cloudtrail.go +++ b/providers/aws/resources/aws_cloudtrail.go @@ -61,6 +61,11 @@ func initAwsCloudtrailTrail(runtime *plugin.Runtime, args map[string]*llx.RawDat nameVal := args["name"].Value.(string) arn = fmt.Sprintf(s3ArnPattern, nameVal) } + + if arn == "" { + return nil, nil, errors.New("arn or name required to fetch aws cloudtrail trail") + } + log.Debug().Str("arn", arn).Msg("init cloudtrail trail with arn") // load all s3 buckets