@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:50.787Z") public interface CustomRuleProps extends RuleProps
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_14_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(); // 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)) .build());
Modifier and Type | Interface and Description |
---|---|
static class |
CustomRuleProps.Builder
A builder for
CustomRuleProps |
static class |
CustomRuleProps.Jsii$Proxy
An implementation for
CustomRuleProps |
Modifier and Type | Method and Description |
---|---|
static CustomRuleProps.Builder |
builder() |
default java.lang.Boolean |
getConfigurationChanges()
Whether to run the rule on configuration changes.
|
IFunction |
getLambdaFunction()
The Lambda function to run.
|
default java.lang.Boolean |
getPeriodic()
Whether to run the rule on a fixed frequency.
|
getConfigRuleName, getDescription, getInputParameters, getMaximumExecutionFrequency, getRuleScope
IFunction getLambdaFunction()
default java.lang.Boolean getConfigurationChanges()
Default: false
default java.lang.Boolean getPeriodic()
Default: false
static CustomRuleProps.Builder builder()
builder
in interface RuleProps
CustomRuleProps.Builder
of CustomRuleProps