Class AlarmFactory
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
com.cloudforgeci.api.core.annotation.BaseFactory
com.cloudforgeci.api.observability.AlarmFactory
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
Creates CloudWatch alarms for application health monitoring.
This factory sets up alarms to notify you when your infrastructure isn't behaving as expected. Alarms are automatically tuned based on your security profile - stricter thresholds in production, more relaxed in development.
Alarms Created
- ALB 5xx Errors - Backend server errors indicating infrastructure problems
- ALB 4xx Errors - Client errors that might indicate misconfiguration
- High Response Time - Performance degradation alerts
Usage
new AlarmFactory(this, "Alarms", new AlarmFactory.Props());
The factory automatically connects to your load balancer through the context system. All alarms adapt to your environment - production gets strict monitoring, development stays lenient to avoid alert fatigue.
Threshold Examples
| Alarm | Dev | Staging | Production |
|---|---|---|---|
| 5xx Errors | 10/min | 7/min | 5/min |
| 4xx Errors | 50/5min | 30/5min | 20/5min |
| Response Time | 5s | 3s | 2s |
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration properties for alarm creation.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy -
Field Summary
Fields inherited from class com.cloudforgeci.api.core.annotation.BaseFactory
cfc, config, ctx -
Constructor Summary
ConstructorsConstructorDescriptionAlarmFactory(software.constructs.Construct scope, String id, AlarmFactory.Props p) Creates a new alarm factory. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Creates CloudWatch alarms for the application load balancer.Methods inherited from class com.cloudforgeci.api.core.annotation.BaseFactory
getDeploymentContext, getSecurityProfileConfiguration, getSystemContextMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
AlarmFactory
Creates a new alarm factory.- Parameters:
scope- the CDK construct scopeid- the construct IDp- configuration properties (reserved for future use)
-
-
Method Details
-
create
public void create()Creates CloudWatch alarms for the application load balancer.Sets up multiple alarms covering error rates and response times. All thresholds adapt automatically to your security profile for appropriate sensitivity in each environment.
Lifecycle: Alarms are automatically deleted when the CloudFormation stack is destroyed. No manual cleanup required.
- Specified by:
createin classBaseFactory
-