Skip to content

Instantly share code, notes, and snippets.

@fsanal
Created December 12, 2022 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fsanal/90d7bdd0b542d7798bf5807d69ae2c68 to your computer and use it in GitHub Desktop.
Save fsanal/90d7bdd0b542d7798bf5807d69ae2c68 to your computer and use it in GitHub Desktop.
public AnalyticsEventMonitor(final Construct scope, final String id, final AnalyticsEventMonitorProps props) {
super(scope, id);
lambdaExecutionRole = props.getLambdaExecutionRole();
dlqTopics = props.getDlqTopics();
infraLambda = props.getInfraLambda();
getProperties();
monitoringAlarms.addAll(props.getKinesisPipelines().stream()
.map(pipeline ->
KinesisAlarmSystem.Builder.create(this, String.format("%sAlarmSystem", pipeline.getNode().getId()))
.kinesisPipeline(pipeline)
.build()
.getMonitoringAlarms())
.flatMap(Collection::stream)
.collect(Collectors.toList()));
monitoringAlarms.addAll(
ApiGatewayAlarmSystem.Builder.create(this, String.format("%sAlarmSystem", props.getApi().getNode().getId()))
.api(props.getApi())
.build()
.getMonitoringAlarms()
);
monitoringTopic = createCloudwatchAlarmTopic();
monitoringLambda = createAnalyticsInfraMonitoringLambda();
createMonitoringSubscriptions();
createAlarmEventBridge();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment