Class AutomationRule


  • public class AutomationRule
    extends com.pulumi.resources.CustomResource
    Resource for managing an AWS Security Hub Automation Rule. ## Example Usage ### Basic Usage <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.securityhub.AutomationRule;
     import com.pulumi.aws.securityhub.AutomationRuleArgs;
     import com.pulumi.aws.securityhub.inputs.AutomationRuleActionArgs;
     import com.pulumi.aws.securityhub.inputs.AutomationRuleActionFindingFieldsUpdateArgs;
     import com.pulumi.aws.securityhub.inputs.AutomationRuleActionFindingFieldsUpdateSeverityArgs;
     import com.pulumi.aws.securityhub.inputs.AutomationRuleActionFindingFieldsUpdateNoteArgs;
     import com.pulumi.aws.securityhub.inputs.AutomationRuleCriteriaArgs;
     import java.util.List;
     import java.util.ArrayList;
     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 AutomationRule("example", AutomationRuleArgs.builder()
                 .description("Elevate finding severity to CRITICAL when specific resources such as an S3 bucket is at risk")
                 .ruleName("Elevate severity of findings that relate to important resources")
                 .ruleOrder(1)
                 .actions(AutomationRuleActionArgs.builder()
                     .findingFieldsUpdate(AutomationRuleActionFindingFieldsUpdateArgs.builder()
                         .severity(AutomationRuleActionFindingFieldsUpdateSeverityArgs.builder()
                             .label("CRITICAL")
                             .product("0.0")
                             .build())
                         .note(AutomationRuleActionFindingFieldsUpdateNoteArgs.builder()
                             .text("This is a critical resource. Please review ASAP.")
                             .updatedBy("sechub-automation")
                             .build())
                         .types("Software and Configuration Checks/Industry and Regulatory Standards")
                         .userDefinedFields(Map.of("key", "value"))
                         .build())
                     .type("FINDING_FIELDS_UPDATE")
                     .build())
                 .criteria(AutomationRuleCriteriaArgs.builder()
                     .resourceIds(AutomationRuleCriteriaResourceIdArgs.builder()
                         .comparison("EQUALS")
                         .value("arn:aws:s3:::examplebucket/*")
                         .build())
                     .build())
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import Security Hub automation rule using their ARN. For example: ```sh $ pulumi import aws:securityhub/automationRule:AutomationRule example arn:aws:securityhub:us-west-2:123456789012:automation-rule/473eddde-f5c4-4ae5-85c7-e922f271fffc ```
    • 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.util.Optional<java.util.List<AutomationRuleAction>>> actions()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<AutomationRuleCriteria>> criteria()  
      com.pulumi.core.Output<java.lang.String> description()  
      static AutomationRule get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, AutomationRuleState 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.Boolean> isTerminal()  
      com.pulumi.core.Output<java.lang.String> ruleName()  
      com.pulumi.core.Output<java.lang.Integer> ruleOrder()  
      com.pulumi.core.Output<java.lang.String> ruleStatus()  
      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

      • AutomationRule

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

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

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

      • actions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<AutomationRuleAction>>> actions()
        Returns:
        A block that specifies one or more actions to update finding fields if a finding matches the conditions specified in `Criteria`. Documented below.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The ARN of the Security Hub automation rule.
      • criteria

        public com.pulumi.core.Output<java.util.Optional<AutomationRuleCriteria>> criteria()
        Returns:
        A block that specifies a set of ASFF finding field attributes and corresponding expected values that Security Hub uses to filter findings. Documented below.
      • description

        public com.pulumi.core.Output<java.lang.String> description()
        Returns:
        The description of the rule.
      • isTerminal

        public com.pulumi.core.Output<java.lang.Boolean> isTerminal()
        Returns:
        Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. Defaults to `false`.
      • ruleName

        public com.pulumi.core.Output<java.lang.String> ruleName()
        Returns:
        The name of the rule.
      • ruleOrder

        public com.pulumi.core.Output<java.lang.Integer> ruleOrder()
        Returns:
        An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub applies rules with lower values for this parameter first.
      • ruleStatus

        public com.pulumi.core.Output<java.lang.String> ruleStatus()
        Returns:
        Whether the rule is active after it is created.
      • 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 AutomationRule get​(java.lang.String name,
                                         com.pulumi.core.Output<java.lang.String> id,
                                         @Nullable
                                         AutomationRuleState 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.