code: func (lad *LogAggregatorDecorator) DecorateTemplate(serviceName string,
  	lambdaResourceName string,
  	lambdaResource gocf.LambdaFunction,
  	resourceMetadata map[string]interface{},
  	S3Bucket string,
  	S3Key string,
  	buildID string,
  	template *gocf.Template,
  	context map[string]interface{},
  	logger *logrus.Logger) error {
  
  	// The relay function should consume the stream
  	if lad.logRelay.LogicalResourceName() == lambdaResourceName {
  		// Need to add a Lambda EventSourceMapping
  		eventSourceMappingResourceName := sparta.CloudFormationResourceName("LogAggregator",
  			"EventSourceMapping",
  			lambdaResourceName)
  
  		template.AddResource(eventSourceMappingResourceName, &gocf.LambdaEventSourceMapping{
  			StartingPosition: gocf.String(lad.kinesisMapping.StartingPosition),
  			BatchSize:        gocf.Integer(lad.kinesisMapping.BatchSize),
  			EventSourceArn:   gocf.GetAtt(lad.kinesisStreamResourceName, "Arn"),
  			FunctionName:     gocf.GetAtt(lambdaResourceName, "Arn"),
  		})
  	} else {
  		// The other functions should publish their logs to the stream
  		subscriptionName := logAggregatorResName(fmt.Sprintf("Lambda%s", lambdaResourceName))
  		subscriptionFilterRes := &gocf.LogsSubscriptionFilter{
  			DestinationArn: gocf.GetAtt(lad.kinesisStreamResourceName, "Arn"),
  			RoleArn:        gocf.GetAtt(lad.iamRoleNameResourceName, "Arn"),
  			LogGroupName: gocf.Join("",
  				gocf.String("/aws/lambda/"),
  				gocf.Ref(lambdaResourceName)),
  			FilterPattern: gocf.String("{$.level = info || $.level = warning || $.level = error }"),
  		}
  		template.AddResource(subscriptionName, subscriptionFilterRes)
  	}
  	return nil
  }
docs: // DecorateTemplate annotates the lambda with the log forwarding sink info