Skip to content

Commit

Permalink
using the more common prefix function
Browse files Browse the repository at this point in the history
  • Loading branch information
gemabarni committed Apr 23, 2019
1 parent 379cefe commit 74be63d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x-pack/functionbeat/provider/aws/kinesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
Expand Down

0 comments on commit 74be63d

Please sign in to comment.