diff --git a/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js b/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js index a30e1cc25..a48db5ceb 100644 --- a/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js +++ b/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js @@ -103,12 +103,16 @@ class AwsCompileCognitoUserPoolEvents { const userPoolLogicalId = this.provider.naming.getCognitoUserPoolLogicalId(poolName); + const DependsOn = _.map(currentPoolTriggerFunctions, (value) => this + .provider.naming.getLambdaLogicalId(value.functionName)); + const userPoolTemplate = { Type: 'AWS::Cognito::UserPool', Properties: { UserPoolName: poolName, LambdaConfig: lambdaConfig, }, + DependsOn, }; // Check if pool name has been declared in `Resources` and the resource has