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* diff --git a/x-pack/functionbeat/provider/aws/kinesis.go b/x-pack/functionbeat/provider/aws/kinesis.go index df8f1df747b2..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("fnb"+k.config.Name, "Arn"), + FunctionName: cloudformation.GetAtt(prefix(""), "Arn"), StartingPosition: trigger.StartingPosition.String(), } }