Interface CustomRuleProps

All Superinterfaces:, RuleProps
All Known Implementing Classes:

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:48.617Z") @Stability(Stable) public interface CustomRuleProps extends, RuleProps
Construction properties for a CustomRule.


 // Lambda function containing logic that evaluates compliance with the rule.
 Function evalComplianceFn = Function.Builder.create(this, "CustomFunction")
         .code(AssetCode.fromInline("exports.handler = (event) => console.log(event);"))
 // A custom rule that runs on configuration changes of EC2 instances
 CustomRule customRule = CustomRule.Builder.create(this, "Custom")
 // A rule to detect stack drifts
 CloudFormationStackDriftDetectionCheck driftRule = new CloudFormationStackDriftDetectionCheck(this, "Drift");
 // Topic to which compliance notification events will be published
 Topic complianceTopic = new Topic(this, "ComplianceTopic");
 // Send notification on compliance change events
 driftRule.onComplianceChange("ComplianceChange", OnEventOptions.builder()
         .target(new SnsTopic(complianceTopic))
  • Method Details

    • getLambdaFunction

      @Stability(Stable) @NotNull IFunction getLambdaFunction()
      The Lambda function to run.
    • getConfigurationChanges

      @Stability(Stable) @Nullable default Boolean getConfigurationChanges()
      Whether to run the rule on configuration changes.

      Default: false

    • getPeriodic

      @Stability(Stable) @Nullable default Boolean getPeriodic()
      Whether to run the rule on a fixed frequency.

      Default: false

    • builder

      @Stability(Stable) static CustomRuleProps.Builder builder()
      a CustomRuleProps.Builder of CustomRuleProps