lib/plugins/aws/package/compile/events/cognitoUserPool/index.js/AwsCompileCognitoUserPoolEvents/generateTemplateForPool
class AwsCompileCognitoUserPoolEvents:  generateTemplateForPool(poolName, currentPoolTriggerFunctions) {
    const lambdaConfig = _.reduce(currentPoolTriggerFunctions, (result, value) => {
      const lambdaLogicalId = this.provider.naming.getLambdaLogicalId(value.functionName);

      // Return a new object to avoid lint errors
      return Object.assign({}, result, {
        [value.triggerSource]: {
          'Fn::GetAtt': [
            lambdaLogicalId,
            'Arn',
          ],
        },
      });
    }, {});

    const userPoolLogicalId = this.provider.naming.getCognitoUserPoolLogicalId(poolName);

    // Attach `DependsOn` for any relevant Lambdas
    const DependsOn = _.map(currentPoolTriggerFunctions, (value) => this
      .provider.naming.getLambdaLogicalId(value.functionName));

    return {
      [userPoolLogicalId]: {
        Type: 'AWS::Cognito::UserPool',
        Properties: {
          UserPoolName: poolName,
          LambdaConfig: lambdaConfig,
        },
        DependsOn,
      },
    };
  }