Skip to content
v2.277.0

NotificationRuleProperty Struct Added in v2.277.0 ​

A notification rule: which alert states trigger it, and where the notification is sent.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const notificationRuleProperty: cloudwatch.CfnAlert.NotificationRuleProperty = {
  target: {
    arn: 'arn',
    type: 'type',

    // the properties below are optional
    metadata: {
      metadataKey: 'metadata',
    },
  },
  trigger: {
    stateValues: ['stateValues'],
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudwatch as cloudwatch

notification_rule_property = cloudwatch.CfnAlert.NotificationRuleProperty(
    target=cloudwatch.CfnAlert.TargetProperty(
        arn="arn",
        type="type",

        # the properties below are optional
        metadata={
            "metadata_key": "metadata"
        }
    ),
    trigger=cloudwatch.CfnAlert.TriggerProperty(
        state_values=["stateValues"]
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudwatch.*;

NotificationRuleProperty notificationRuleProperty = NotificationRuleProperty.builder()
        .target(TargetProperty.builder()
                .arn("arn")
                .type("type")

                // the properties below are optional
                .metadata(Map.of(
                        "metadataKey", "metadata"))
                .build())
        .trigger(TriggerProperty.builder()
                .stateValues(List.of("stateValues"))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudWatch;

var notificationRuleProperty = new NotificationRuleProperty {
    Target = new TargetProperty {
        Arn = "arn",
        Type = "type",

        // the properties below are optional
        Metadata = new Dictionary<string, string> {
            { "metadataKey", "metadata" }
        }
    },
    Trigger = new TriggerProperty {
        StateValues = new [] { "stateValues" }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

notificationRuleProperty := &NotificationRuleProperty{
	Target: &TargetProperty{
		Arn: jsii.String("arn"),
		Type: jsii.String("type"),

		// the properties below are optional
		Metadata: map[string]*string{
			"metadataKey": jsii.String("metadata"),
		},
	},
	Trigger: &TriggerProperty{
		StateValues: []*string{
			jsii.String("stateValues"),
		},
	},
}

Properties ​

targetIResolvable | CfnAlert.TargetPropertytargettyping.Union[IResolvable, TargetProperty]targetIResolvableTargetIResolvableTargetinterface{}required#
Where the notification is sent.
triggerIResolvable | CfnAlert.TriggerPropertytriggertyping.Union[IResolvable, TriggerProperty]triggerIResolvableTriggerIResolvableTriggerinterface{}required#
The alert states that trigger the notification rule.