Configure Alert for Large Number of User Signups
Last Updated:
Overview
This article provides two methods for tracking user signups with the goal of configuring 3rd party alerting based on unusual activity.
Applies To
- Logs
- User Signups
Solution
- Log streaming: One option is to stream logs to an analytics tool and configure 3rd party alerts based on the resulting user sign-ups indicated in the logs.
- Extensibility: Create a post-user registration actions trigger that calls an external API that increments a counter on a database.
- The following example provides a proof of concept that could perform this action:
const axios = require("axios");
const MAX_USER_COUNT = 50000;
exports.onExecutePreUserRegistration = async (event, api) => {
const userCount = await axios.get("https://my-api.exampleco.com/userCount");
if (userCount > MAX_USER_COUNT) {
api.access.deny("Registration limit reached.", "Registration is limited to 50,000 users.")
return;
}
await axios.post("https://my-api.exampleco.com/userSignup", { inc: 1 });
};