From 379cefec9f4e9481d89253e70206b3d6ee938417 Mon Sep 17 00:00:00 2001 From: Barnabas Gema Date: Tue, 23 Apr 2019 15:10:11 +0200 Subject: [PATCH 1/3] fixes function name reference --- x-pack/functionbeat/provider/aws/kinesis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/functionbeat/provider/aws/kinesis.go b/x-pack/functionbeat/provider/aws/kinesis.go index df8f1df747b2..29d1474fc247 100644 --- a/x-pack/functionbeat/provider/aws/kinesis.go +++ b/x-pack/functionbeat/provider/aws/kinesis.go @@ -166,7 +166,7 @@ func (k *Kinesis) Template() *cloudformation.Template { template.Resources[resourceName] = &cloudformation.AWSLambdaEventSourceMapping{ BatchSize: trigger.BatchSize, EventSourceArn: trigger.EventSourceArn, - FunctionName: cloudformation.GetAtt("fnb"+k.config.Name, "Arn"), + FunctionName: cloudformation.GetAtt(normalizeResourceName("fnb"+k.config.Name), "Arn"), StartingPosition: trigger.StartingPosition.String(), } } From 74be63da58d05b33102f967aa3220721d5dd9311 Mon Sep 17 00:00:00 2001 From: Barnabas Gema Date: Tue, 23 Apr 2019 15:10:29 +0200 Subject: [PATCH 2/3] using the more common prefix function --- x-pack/functionbeat/provider/aws/kinesis.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/functionbeat/provider/aws/kinesis.go b/x-pack/functionbeat/provider/aws/kinesis.go index 29d1474fc247..56df5ab83dfe 100644 --- a/x-pack/functionbeat/provider/aws/kinesis.go +++ b/x-pack/functionbeat/provider/aws/kinesis.go @@ -158,15 +158,15 @@ func (k *Kinesis) LambdaConfig() *lambdaConfig { func (k *Kinesis) Template() *cloudformation.Template { template := cloudformation.NewTemplate() prefix := func(suffix string) string { - return normalizeResourceName("fnb" + k.config.Name + k.Name() + suffix) + return normalizeResourceName("fnb" + k.config.Name + suffix) } for _, trigger := range k.config.Triggers { - resourceName := prefix(trigger.EventSourceArn) + resourceName := prefix(k.Name() + trigger.EventSourceArn) template.Resources[resourceName] = &cloudformation.AWSLambdaEventSourceMapping{ BatchSize: trigger.BatchSize, EventSourceArn: trigger.EventSourceArn, - FunctionName: cloudformation.GetAtt(normalizeResourceName("fnb"+k.config.Name), "Arn"), + FunctionName: cloudformation.GetAtt(prefix(""), "Arn"), StartingPosition: trigger.StartingPosition.String(), } } From 261a213090bba15c52c5a0fedf70f482f9923424 Mon Sep 17 00:00:00 2001 From: Barnabas Gema Date: Tue, 23 Apr 2019 15:06:48 +0200 Subject: [PATCH 3/3] adds changelog entry --- CHANGELOG.next.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index e019a31f3463..fb1d9874bed7 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -101,6 +101,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d *Functionbeat* +- Fix function name reference for Kinesis streams in CloudFormation templates {pull}11646[11646] + ==== Added *Affecting all Beats*