Class CfnNotificationRule

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.codestarnotifications.CfnNotificationRule
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-17T21:37:28.385Z") @Stability(Stable) public class CfnNotificationRule extends CfnResource implements IInspectable, ITaggable
Creates a notification rule for a resource.

The rule specifies the events you want notifications about and the targets (such as Amazon Simple Notification Service topics or AWS Chatbot clients configured for Slack) where you want to receive them.

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.codestarnotifications.*;
 CfnNotificationRule cfnNotificationRule = CfnNotificationRule.Builder.create(this, "MyCfnNotificationRule")
         .detailType("detailType")
         .eventTypeIds(List.of("eventTypeIds"))
         .name("name")
         .resource("resource")
         .targets(List.of(TargetProperty.builder()
                 .targetAddress("targetAddress")
                 .targetType("targetType")
                 .build()))
         // the properties below are optional
         .createdBy("createdBy")
         .eventTypeId("eventTypeId")
         .status("status")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .targetAddress("targetAddress")
         .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

    • CfnNotificationRule

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

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

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

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the notification rule.
    • 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
    • getDetailType

      @Stability(Stable) @NotNull public String getDetailType()
      The level of detail to include in the notifications for this resource.
    • setDetailType

      @Stability(Stable) public void setDetailType(@NotNull String value)
      The level of detail to include in the notifications for this resource.
    • getEventTypeIds

      @Stability(Stable) @NotNull public List<String> getEventTypeIds()
      A list of event types associated with this notification rule.
    • setEventTypeIds

      @Stability(Stable) public void setEventTypeIds(@NotNull List<String> value)
      A list of event types associated with this notification rule.
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name for the notification rule.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name for the notification rule.
    • getResource

      @Stability(Stable) @NotNull public String getResource()
      The Amazon Resource Name (ARN) of the resource to associate with the notification rule.
    • setResource

      @Stability(Stable) public void setResource(@NotNull String value)
      The Amazon Resource Name (ARN) of the resource to associate with the notification rule.
    • getTargets

      @Stability(Stable) @NotNull public Object getTargets()
      A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
    • setTargets

      @Stability(Stable) public void setTargets(@NotNull IResolvable value)
      A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
    • setTargets

      @Stability(Stable) public void setTargets(@NotNull List<Object> value)
      A list of Amazon Resource Names (ARNs) of Amazon SNS topics and AWS Chatbot clients to associate with the notification rule.
    • getCreatedBy

      @Stability(Stable) @Nullable public String getCreatedBy()
      The name or email alias of the person who created the notification rule.
    • setCreatedBy

      @Stability(Stable) public void setCreatedBy(@Nullable String value)
      The name or email alias of the person who created the notification rule.
    • getEventTypeId

      @Stability(Stable) @Nullable public String getEventTypeId()
      The event type associated with this notification rule.
    • setEventTypeId

      @Stability(Stable) public void setEventTypeId(@Nullable String value)
      The event type associated with this notification rule.
    • getStatus

      @Stability(Stable) @Nullable public String getStatus()
      The status of the notification rule.
    • setStatus

      @Stability(Stable) public void setStatus(@Nullable String value)
      The status of the notification rule.
    • getTagsRaw

      @Stability(Stable) @Nullable public Map<String,String> getTagsRaw()
      A list of tags to apply to this notification rule.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Map<String,String> value)
      A list of tags to apply to this notification rule.
    • getTargetAddress

      @Stability(Stable) @Nullable public String getTargetAddress()
      The Amazon Resource Name (ARN) of the Amazon SNS topic or AWS Chatbot client.
    • setTargetAddress

      @Stability(Stable) public void setTargetAddress(@Nullable String value)
      The Amazon Resource Name (ARN) of the Amazon SNS topic or AWS Chatbot client.