Class ManagedRule

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.config.ManagedRule
All Implemented Interfaces:
IResource, IRule, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
AccessKeysRotated, CloudFormationStackDriftDetectionCheck, CloudFormationStackNotificationCheck

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-06T14:43:16.548Z") @Stability(Stable) public class ManagedRule extends Resource implements IRule
A new managed rule.

Example:

 Function fn;
 String samplePolicyText;
 ManagedRule.Builder.create(this, "ManagedRule")
         .identifier(ManagedRuleIdentifiers.API_GW_XRAY_ENABLED)
         .evaluationModes(EvaluationMode.DETECTIVE_AND_PROACTIVE)
         .build();
 CustomRule.Builder.create(this, "CustomRule")
         .lambdaFunction(fn)
         .evaluationModes(EvaluationMode.PROACTIVE)
         .build();
 CustomPolicy.Builder.create(this, "CustomPolicy")
         .policyText(samplePolicyText)
         .evaluationModes(EvaluationMode.DETECTIVE)
         .build();
 
  • Constructor Details

    • ManagedRule

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

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

      @Stability(Stable) public ManagedRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ManagedRuleProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromConfigRuleName

      @Stability(Stable) @NotNull public static IRule fromConfigRuleName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String configRuleName)
      Imports an existing rule.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      configRuleName - the name of the rule. This parameter is required.
    • onComplianceChange

      @Stability(Stable) @NotNull public Rule onComplianceChange(@NotNull String id, @Nullable OnEventOptions options)
      Defines an EventBridge event rule which triggers for rule compliance events.

      Specified by:
      onComplianceChange in interface IRule
      Parameters:
      id - This parameter is required.
      options -
    • onComplianceChange

      @Stability(Stable) @NotNull public Rule onComplianceChange(@NotNull String id)
      Defines an EventBridge event rule which triggers for rule compliance events.

      Specified by:
      onComplianceChange in interface IRule
      Parameters:
      id - This parameter is required.
    • onEvent

      @Stability(Stable) @NotNull public Rule onEvent(@NotNull String id, @Nullable OnEventOptions options)
      Defines an EventBridge event rule which triggers for rule events.

      Use rule.addEventPattern(pattern) to specify a filter.

      Specified by:
      onEvent in interface IRule
      Parameters:
      id - This parameter is required.
      options -
    • onEvent

      @Stability(Stable) @NotNull public Rule onEvent(@NotNull String id)
      Defines an EventBridge event rule which triggers for rule events.

      Use rule.addEventPattern(pattern) to specify a filter.

      Specified by:
      onEvent in interface IRule
      Parameters:
      id - This parameter is required.
    • onReEvaluationStatus

      @Stability(Stable) @NotNull public Rule onReEvaluationStatus(@NotNull String id, @Nullable OnEventOptions options)
      Defines an EventBridge event rule which triggers for rule re-evaluation status events.

      Specified by:
      onReEvaluationStatus in interface IRule
      Parameters:
      id - This parameter is required.
      options -
    • onReEvaluationStatus

      @Stability(Stable) @NotNull public Rule onReEvaluationStatus(@NotNull String id)
      Defines an EventBridge event rule which triggers for rule re-evaluation status events.

      Specified by:
      onReEvaluationStatus in interface IRule
      Parameters:
      id - This parameter is required.
    • getConfigRuleArn

      @Stability(Stable) @NotNull public String getConfigRuleArn()
      The arn of the rule.
    • getConfigRuleComplianceType

      @Stability(Stable) @NotNull public String getConfigRuleComplianceType()
      The compliance status of the rule.
    • getConfigRuleId

      @Stability(Stable) @NotNull public String getConfigRuleId()
      The id of the rule.
    • getConfigRuleName

      @Stability(Stable) @NotNull public String getConfigRuleName()
      The name of the rule.
      Specified by:
      getConfigRuleName in interface IRule
    • getIsCustomWithChanges

      @Stability(Stable) @Nullable protected Boolean getIsCustomWithChanges()
    • setIsCustomWithChanges

      @Stability(Stable) protected void setIsCustomWithChanges(@Nullable Boolean value)
    • getIsManaged

      @Stability(Stable) @Nullable protected Boolean getIsManaged()
    • setIsManaged

      @Stability(Stable) protected void setIsManaged(@Nullable Boolean value)
    • getRuleScope

      @Stability(Stable) @Nullable protected RuleScope getRuleScope()
    • setRuleScope

      @Stability(Stable) protected void setRuleScope(@Nullable RuleScope value)