Interface CustomRuleProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,RuleProps
- All Known Implementing Classes:
CustomRuleProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.97.0 (build 729de35)",
date="2024-04-18T17:54:14.716Z")
@Stability(Stable)
public interface CustomRuleProps
extends software.amazon.jsii.JsiiSerializable, RuleProps
Construction properties for a CustomRule.
Example:
// 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);")) .handler("index.handler") .runtime(Runtime.NODEJS_18_X) .build(); // A custom rule that runs on configuration changes of EC2 instances CustomRule customRule = CustomRule.Builder.create(this, "Custom") .configurationChanges(true) .lambdaFunction(evalComplianceFn) .ruleScope(RuleScope.fromResource(ResourceType.EC2_INSTANCE)) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forCustomRuleProps
static final class
An implementation forCustomRuleProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomRuleProps.Builder
builder()
default Boolean
Whether to run the rule on configuration changes.The Lambda function to run.default Boolean
Whether to run the rule on a fixed frequency.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods inherited from interface software.amazon.awscdk.services.config.RuleProps
getConfigRuleName, getDescription, getInputParameters, getMaximumExecutionFrequency, getRuleScope
-
Method Details
-
getLambdaFunction
The Lambda function to run. -
getConfigurationChanges
Whether to run the rule on configuration changes.Default: false
-
getPeriodic
Whether to run the rule on a fixed frequency.Default: false
-
builder
- Returns:
- a
CustomRuleProps.Builder
ofCustomRuleProps
-