Class CfnNotificationRule

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:55.916Z") @Stability(Stable) public class CfnNotificationRule extends CfnResource implements IInspectable
A CloudFormation AWS::CodeStarNotifications::NotificationRule.

Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as AWS Chatbot 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();
 
  • 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 Construct scope, @NotNull String id, @NotNull CfnNotificationRuleProps props)
      Create a new AWS::CodeStarNotifications::NotificationRule.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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()
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      A list of tags to apply to this notification rule.

      Key names cannot start with " aws ".

    • getDetailType

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

      BASIC will include only the contents of the event as it would appear in Amazon CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.

    • setDetailType

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

      BASIC will include only the contents of the event as it would appear in Amazon CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.

    • getEventTypeIds

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

      For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide .

    • setEventTypeIds

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

      For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide .

    • getName

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

      Notification rule names must be unique in your AWS account .

    • setName

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

      Notification rule names must be unique in your AWS account .

    • getResource

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

      Supported resources include pipelines in AWS CodePipeline , repositories in AWS CodeCommit , and build projects in AWS CodeBuild .

    • setResource

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

      Supported resources include pipelines in AWS CodePipeline , repositories in AWS CodeCommit , and build projects in AWS CodeBuild .

    • getTargets

      @Stability(Stable) @NotNull public Object getTargets()
      A list of Amazon Resource Names (ARNs) of Amazon Simple Notification Service 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 Simple Notification Service 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 Simple Notification Service topics and AWS Chatbot clients to associate with the notification rule.
    • getCreatedBy

      @Stability(Stable) @Nullable public String getCreatedBy()
      AWS::CodeStarNotifications::NotificationRule.CreatedBy.
    • setCreatedBy

      @Stability(Stable) public void setCreatedBy(@Nullable String value)
      AWS::CodeStarNotifications::NotificationRule.CreatedBy.
    • getEventTypeId

      @Stability(Stable) @Nullable public String getEventTypeId()
      AWS::CodeStarNotifications::NotificationRule.EventTypeId.
    • setEventTypeId

      @Stability(Stable) public void setEventTypeId(@Nullable String value)
      AWS::CodeStarNotifications::NotificationRule.EventTypeId.
    • getStatus

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

      The default value is ENABLED . If the status is set to DISABLED , notifications aren't sent for the notification rule.

    • setStatus

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

      The default value is ENABLED . If the status is set to DISABLED , notifications aren't sent for the notification rule.

    • getTargetAddress

      @Stability(Stable) @Nullable public String getTargetAddress()
      AWS::CodeStarNotifications::NotificationRule.TargetAddress.
    • setTargetAddress

      @Stability(Stable) public void setTargetAddress(@Nullable String value)
      AWS::CodeStarNotifications::NotificationRule.TargetAddress.