Class EventRule


  • public class EventRule
    extends com.pulumi.resources.CustomResource
    Resource for managing an AWS User Notifications Event Rule. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.notifications.NotificationConfiguration;
     import com.pulumi.aws.notifications.NotificationConfigurationArgs;
     import com.pulumi.aws.notifications.EventRule;
     import com.pulumi.aws.notifications.EventRuleArgs;
     import static com.pulumi.codegen.internal.Serialization.*;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new NotificationConfiguration("example", NotificationConfigurationArgs.builder()
                 .name("example")
                 .description("example configuration")
                 .build());
     
             var exampleEventRule = new EventRule("exampleEventRule", EventRuleArgs.builder()
                 .eventPattern(serializeJson(
                     jsonObject(
                         jsonProperty("detail", jsonObject(
                             jsonProperty("state", jsonObject(
                                 jsonProperty("value", jsonArray("ALARM"))
                             ))
                         ))
                     )))
                 .eventType("CloudWatch Alarm State Change")
                 .notificationConfigurationArn(example.arn())
                 .regions(            
                     "us-east-1",
                     "us-west-2")
                 .source("aws.cloudwatch")
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import User Notifications Event Rule using the `arn`. For example: ```sh $ pulumi import aws:notifications/eventRule:EventRule example arn:aws:notifications::123456789012:configuration/abc123def456ghi789jkl012mno345/rule/abc123def456ghi789jkl012mno345 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      EventRule​(java.lang.String name)  
      EventRule​(java.lang.String name, EventRuleArgs args)  
      EventRule​(java.lang.String name, EventRuleArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> eventPattern()  
      com.pulumi.core.Output<java.lang.String> eventType()  
      static EventRule get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, EventRuleState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> notificationConfigurationArn()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> regions()  
      com.pulumi.core.Output<java.lang.String> source()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventRule

        public EventRule​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • EventRule

        public EventRule​(java.lang.String name,
                         EventRuleArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • EventRule

        public EventRule​(java.lang.String name,
                         EventRuleArgs args,
                         @Nullable
                         com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the Event Rule.
      • eventPattern

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> eventPattern()
        Returns:
        JSON string defining the event pattern to match. Maximum length is 4096 characters.
      • eventType

        public com.pulumi.core.Output<java.lang.String> eventType()
        Returns:
        Type of event to match. Must be between 1 and 128 characters, and match the pattern `([a-zA-Z0-9 \-\(\)])+`.
      • notificationConfigurationArn

        public com.pulumi.core.Output<java.lang.String> notificationConfigurationArn()
        Returns:
        ARN of the notification configuration to associate with this event rule. Must match the pattern `arn:aws:notifications::[0-9]{12}:configuration/[a-z0-9]{27}`.
      • regions

        public com.pulumi.core.Output<java.util.List<java.lang.String>> regions()
        Returns:
        Set of AWS regions where the event rule will be applied. Each region must be between 2 and 25 characters, and match the pattern `([a-z]{1,2})-([a-z]{1,15}-)+([0-9])`.
      • source

        public com.pulumi.core.Output<java.lang.String> source()
        Returns:
        Source of the event. Must be between 1 and 36 characters, and match the pattern `aws.([a-z0-9\-])+`. The following arguments are optional:
      • get

        public static EventRule get​(java.lang.String name,
                                    com.pulumi.core.Output<java.lang.String> id,
                                    @Nullable
                                    EventRuleState state,
                                    @Nullable
                                    com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.