code: func NewCloudWatchReactor(reactor CloudWatchReactor,
  	subscriptions map[string]sparta.CloudWatchEventsRule,
  	additionalLambdaPermissions []sparta.IAMRolePrivilege) (*sparta.LambdaAWSInfo, error) {
  	if len(subscriptions) <= 0 {
  		return nil, errors.Errorf("CloudWatchLogs subscription map must not be empty")
  	}
  
  	reactorLambda := func(ctx context.Context, cwLogs awsLambdaEvents.CloudwatchLogsEvent) (interface{}, error) {
  		return reactor.OnCloudWatchMessage(ctx, cwLogs)
  	}
  	lambdaFn, lambdaFnErr := sparta.NewAWSLambda(reactorName(reactor),
  		reactorLambda,
  		sparta.IAMRoleDefinition{})
  	if lambdaFnErr != nil {
  		return nil, errors.Wrapf(lambdaFnErr, "attempting to create reactor")
  	}
  	cloudWatchEventsPermission := sparta.CloudWatchEventsPermission{}
  	cloudWatchEventsPermission.Rules = make(map[string]sparta.CloudWatchEventsRule)
  	for eachRuleName, eachRule := range subscriptions {
  		cloudWatchEventsPermission.Rules[eachRuleName] = eachRule
  	}
  	lambdaFn.Permissions = append(lambdaFn.Permissions, cloudWatchEventsPermission)
  
  	if len(additionalLambdaPermissions) != 0 {
  		lambdaFn.RoleDefinition.Privileges = additionalLambdaPermissions
  	}
  	return lambdaFn, nil
  }
docs: // NewCloudWatchReactor returns a CloudWatch logs reactor lambda function