Class CfnAlarmModel

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

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-02T15:58:28.011Z") @Stability(Stable) public class CfnAlarmModel extends CfnResource implements IInspectable, ITaggable
Represents an alarm model to monitor an AWS IoT Events input attribute.

You can use the alarm to get notified when the value is outside a specified range. For more information, see Create an alarm model in the AWS IoT Events Developer Guide .

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.iotevents.*;
 CfnAlarmModel cfnAlarmModel = CfnAlarmModel.Builder.create(this, "MyCfnAlarmModel")
         .alarmRule(AlarmRuleProperty.builder()
                 .simpleRule(SimpleRuleProperty.builder()
                         .comparisonOperator("comparisonOperator")
                         .inputProperty("inputProperty")
                         .threshold("threshold")
                         .build())
                 .build())
         .roleArn("roleArn")
         // the properties below are optional
         .alarmCapabilities(AlarmCapabilitiesProperty.builder()
                 .acknowledgeFlow(AcknowledgeFlowProperty.builder()
                         .enabled(false)
                         .build())
                 .initializationConfiguration(InitializationConfigurationProperty.builder()
                         .disabledOnInitialization(false)
                         .build())
                 .build())
         .alarmEventActions(AlarmEventActionsProperty.builder()
                 .alarmActions(List.of(AlarmActionProperty.builder()
                         .dynamoDb(DynamoDBProperty.builder()
                                 .hashKeyField("hashKeyField")
                                 .hashKeyValue("hashKeyValue")
                                 .tableName("tableName")
                                 // the properties below are optional
                                 .hashKeyType("hashKeyType")
                                 .operation("operation")
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .payloadField("payloadField")
                                 .rangeKeyField("rangeKeyField")
                                 .rangeKeyType("rangeKeyType")
                                 .rangeKeyValue("rangeKeyValue")
                                 .build())
                         .dynamoDBv2(DynamoDBv2Property.builder()
                                 .tableName("tableName")
                                 // the properties below are optional
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .build())
                         .firehose(FirehoseProperty.builder()
                                 .deliveryStreamName("deliveryStreamName")
                                 // the properties below are optional
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .separator("separator")
                                 .build())
                         .iotEvents(IotEventsProperty.builder()
                                 .inputName("inputName")
                                 // the properties below are optional
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .build())
                         .iotSiteWise(IotSiteWiseProperty.builder()
                                 .assetId("assetId")
                                 .entryId("entryId")
                                 .propertyAlias("propertyAlias")
                                 .propertyId("propertyId")
                                 .propertyValue(AssetPropertyValueProperty.builder()
                                         .value(AssetPropertyVariantProperty.builder()
                                                 .booleanValue("booleanValue")
                                                 .doubleValue("doubleValue")
                                                 .integerValue("integerValue")
                                                 .stringValue("stringValue")
                                                 .build())
                                         // the properties below are optional
                                         .quality("quality")
                                         .timestamp(AssetPropertyTimestampProperty.builder()
                                                 .timeInSeconds("timeInSeconds")
                                                 // the properties below are optional
                                                 .offsetInNanos("offsetInNanos")
                                                 .build())
                                         .build())
                                 .build())
                         .iotTopicPublish(IotTopicPublishProperty.builder()
                                 .mqttTopic("mqttTopic")
                                 // the properties below are optional
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .build())
                         .lambda(LambdaProperty.builder()
                                 .functionArn("functionArn")
                                 // the properties below are optional
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .build())
                         .sns(SnsProperty.builder()
                                 .targetArn("targetArn")
                                 // the properties below are optional
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .build())
                         .sqs(SqsProperty.builder()
                                 .queueUrl("queueUrl")
                                 // the properties below are optional
                                 .payload(PayloadProperty.builder()
                                         .contentExpression("contentExpression")
                                         .type("type")
                                         .build())
                                 .useBase64(false)
                                 .build())
                         .build()))
                 .build())
         .alarmModelDescription("alarmModelDescription")
         .alarmModelName("alarmModelName")
         .key("key")
         .severity(123)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .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

    • CfnAlarmModel

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

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

      @Stability(Stable) public CfnAlarmModel(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAlarmModelProps 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.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getAlarmRule

      @Stability(Stable) @NotNull public Object getAlarmRule()
      Defines when your alarm is invoked.
    • setAlarmRule

      @Stability(Stable) public void setAlarmRule(@NotNull IResolvable value)
      Defines when your alarm is invoked.
    • setAlarmRule

      @Stability(Stable) public void setAlarmRule(@NotNull CfnAlarmModel.AlarmRuleProperty value)
      Defines when your alarm is invoked.
    • getRoleArn

      @Stability(Stable) @NotNull public String getRoleArn()
      The ARN of the IAM role that allows the alarm to perform actions and access AWS resources.
    • setRoleArn

      @Stability(Stable) public void setRoleArn(@NotNull String value)
      The ARN of the IAM role that allows the alarm to perform actions and access AWS resources.
    • getAlarmCapabilities

      @Stability(Stable) @Nullable public Object getAlarmCapabilities()
      Contains the configuration information of alarm state changes.
    • setAlarmCapabilities

      @Stability(Stable) public void setAlarmCapabilities(@Nullable IResolvable value)
      Contains the configuration information of alarm state changes.
    • setAlarmCapabilities

      @Stability(Stable) public void setAlarmCapabilities(@Nullable CfnAlarmModel.AlarmCapabilitiesProperty value)
      Contains the configuration information of alarm state changes.
    • getAlarmEventActions

      @Stability(Stable) @Nullable public Object getAlarmEventActions()
      Contains information about one or more alarm actions.
    • setAlarmEventActions

      @Stability(Stable) public void setAlarmEventActions(@Nullable IResolvable value)
      Contains information about one or more alarm actions.
    • setAlarmEventActions

      @Stability(Stable) public void setAlarmEventActions(@Nullable CfnAlarmModel.AlarmEventActionsProperty value)
      Contains information about one or more alarm actions.
    • getAlarmModelDescription

      @Stability(Stable) @Nullable public String getAlarmModelDescription()
      The description of the alarm model.
    • setAlarmModelDescription

      @Stability(Stable) public void setAlarmModelDescription(@Nullable String value)
      The description of the alarm model.
    • getAlarmModelName

      @Stability(Stable) @Nullable public String getAlarmModelName()
      The name of the alarm model.
    • setAlarmModelName

      @Stability(Stable) public void setAlarmModelName(@Nullable String value)
      The name of the alarm model.
    • getKey

      @Stability(Stable) @Nullable public String getKey()
      An input attribute used as a key to create an alarm.
    • setKey

      @Stability(Stable) public void setKey(@Nullable String value)
      An input attribute used as a key to create an alarm.
    • getSeverity

      @Stability(Stable) @Nullable public Number getSeverity()
      A non-negative integer that reflects the severity level of the alarm.
    • setSeverity

      @Stability(Stable) public void setSeverity(@Nullable Number value)
      A non-negative integer that reflects the severity level of the alarm.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      A list of key-value pairs that contain metadata for the alarm model.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      A list of key-value pairs that contain metadata for the alarm model.