java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, IAlertRef, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)", date="2025-10-29T11:15:43.237Z") @Stability(Stable) public class CfnAlert extends CfnResource implements IInspectable, IAlertRef

End of support notice: On Oct 9, 2025, AWS will end support for Amazon Lookout for Metrics.

After Oct 9, 2025, you will no longer be able to access the Amazon Lookout for Metrics console or Amazon Lookout for Metrics resources. For more information, see Amazon Lookout for Metrics end of support .

The AWS::LookoutMetrics::Alert type creates an alert for an anomaly detector.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lookoutmetrics.*;
 CfnAlert cfnAlert = CfnAlert.Builder.create(this, "MyCfnAlert")
         .action(ActionProperty.builder()
                 .lambdaConfiguration(LambdaConfigurationProperty.builder()
                         .lambdaArn("lambdaArn")
                         .roleArn("roleArn")
                         .build())
                 .snsConfiguration(SNSConfigurationProperty.builder()
                         .roleArn("roleArn")
                         .snsTopicArn("snsTopicArn")
                         .build())
                 .build())
         .alertSensitivityThreshold(123)
         .anomalyDetectorArn("anomalyDetectorArn")
         // the properties below are optional
         .alertDescription("alertDescription")
         .alertName("alertName")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAlert

      protected CfnAlert(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAlert

      protected CfnAlert(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAlert

      @Stability(Stable) public CfnAlert(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAlertProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAlertRef

      @Stability(Stable) @NotNull public AlertReference getAlertRef()
      A reference to a Alert resource.
      Specified by:
      getAlertRef in interface IAlertRef
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the alert.

      For example, arn:aws:lookoutmetrics:us-east-2:123456789012:Alert:my-alert

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAction

      @Stability(Stable) @NotNull public Object getAction()
      Action that will be triggered when there is an alert.

      Returns union: either IResolvable or CfnAlert.ActionProperty

    • setAction

      @Stability(Stable) public void setAction(@NotNull IResolvable value)
      Action that will be triggered when there is an alert.
    • setAction

      @Stability(Stable) public void setAction(@NotNull CfnAlert.ActionProperty value)
      Action that will be triggered when there is an alert.
    • getAlertSensitivityThreshold

      @Stability(Stable) @NotNull public Number getAlertSensitivityThreshold()
      An integer from 0 to 100 specifying the alert sensitivity threshold.
    • setAlertSensitivityThreshold

      @Stability(Stable) public void setAlertSensitivityThreshold(@NotNull Number value)
      An integer from 0 to 100 specifying the alert sensitivity threshold.
    • getAnomalyDetectorArn

      @Stability(Stable) @NotNull public String getAnomalyDetectorArn()
      The ARN of the detector to which the alert is attached.
    • setAnomalyDetectorArn

      @Stability(Stable) public void setAnomalyDetectorArn(@NotNull String value)
      The ARN of the detector to which the alert is attached.
    • getAlertDescription

      @Stability(Stable) @Nullable public String getAlertDescription()
      A description of the alert.
    • setAlertDescription

      @Stability(Stable) public void setAlertDescription(@Nullable String value)
      A description of the alert.
    • getAlertName

      @Stability(Stable) @Nullable public String getAlertName()
      The name of the alert.
    • setAlertName

      @Stability(Stable) public void setAlertName(@Nullable String value)
      The name of the alert.