Class LogAnomalyDetector


  • public class LogAnomalyDetector
    extends com.pulumi.resources.CustomResource
    Resource for managing an AWS CloudWatch Logs Log Anomaly Detector. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatch.LogGroup;
     import com.pulumi.aws.cloudwatch.LogGroupArgs;
     import com.pulumi.aws.cloudwatch.LogAnomalyDetector;
     import com.pulumi.aws.cloudwatch.LogAnomalyDetectorArgs;
     import com.pulumi.codegen.internal.KeyedValue;
     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) {
             for (var i = 0; i < 2; i++) {
                 new LogGroup("test-" + i, LogGroupArgs.builder()
                     .name(String.format("testing-%s", range.value()))
                     .build());
     
             
     }
             var testLogAnomalyDetector = new LogAnomalyDetector("testLogAnomalyDetector", LogAnomalyDetectorArgs.builder()
                 .detectorName("testing")
                 .logGroupArnLists(test[0].arn())
                 .anomalyVisibilityTime(7)
                 .evaluationFrequency("TEN_MIN")
                 .enabled(false)
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required - `arn` (String) ARN of the anomaly detector. Using `pulumi import`, import Anomaly Detectors using `arn`. For example: ```sh $ pulumi import aws:cloudwatch/logAnomalyDetector:LogAnomalyDetector example arn:aws:logs:us-east-1:123456789012:anomaly-detector:1a2b3c4d-5e6f-7890-abcd-ef1234567890 ```
    • 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.Integer> anomalyVisibilityTime()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> detectorName()  
      com.pulumi.core.Output<java.lang.Boolean> enabled()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> evaluationFrequency()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> filterPattern()  
      static LogAnomalyDetector get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, LogAnomalyDetectorState 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.util.Optional<java.lang.String>> kmsKeyId()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> logGroupArnLists()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      • 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

      • LogAnomalyDetector

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

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

        public LogAnomalyDetector​(java.lang.String name,
                                  LogAnomalyDetectorArgs 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

      • anomalyVisibilityTime

        public com.pulumi.core.Output<java.lang.Integer> anomalyVisibilityTime()
        Returns:
        Number of days to have visibility on an anomaly. After this time period has elapsed for an anomaly, it will be automatically baselined and the anomaly detector will treat new occurrences of a similar anomaly as normal. Therefore, if you do not correct the cause of an anomaly during the time period specified in `anomalyVisibilityTime`, it will be considered normal going forward and will not be detected as an anomaly. Valid Range: Minimum value of 7. Maximum value of 90.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the log anomaly detector that you just created.
      • detectorName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> detectorName()
        Returns:
        Name for this anomaly detector.
      • enabled

        public com.pulumi.core.Output<java.lang.Boolean> enabled()
      • evaluationFrequency

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> evaluationFrequency()
        Returns:
        Specifies how often the anomaly detector is to run and look for anomalies. Set this value according to the frequency that the log group receives new logs. For example, if the log group receives new log events every 10 minutes, then 15 minutes might be a good setting for `evaluationFrequency`. Valid Values: `ONE_MIN | FIVE_MIN | TEN_MIN | FIFTEEN_MIN | THIRTY_MIN | ONE_HOUR`.
      • filterPattern

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> filterPattern()
        Returns:
        You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).
      • kmsKeyId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()
        Returns:
        Optionally assigns a AWS KMS key to secure this anomaly detector and its findings. If a key is assigned, the anomalies found and the model used by this detector are encrypted at rest with the key. If a key is assigned to an anomaly detector, a user must have permissions for both this key and for the anomaly detector to retrieve information about the anomalies that it finds.
      • logGroupArnLists

        public com.pulumi.core.Output<java.util.List<java.lang.String>> logGroupArnLists()
        Returns:
        Array containing the ARN of the log group that this anomaly detector will watch. You can specify only one log group ARN. The following arguments are optional:
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
      • get

        public static LogAnomalyDetector get​(java.lang.String name,
                                             com.pulumi.core.Output<java.lang.String> id,
                                             @Nullable
                                             LogAnomalyDetectorState 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.