@Generated(value="jsii-pacmak/1.70.0 (build 03c2f6f)", date="2022-11-01T13:16:48.969Z") @Stability(value=Experimental) public interface OnEventOptions extends software.amazon.jsii.JsiiSerializable
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 |
OnEventOptions.Builder
A builder for
OnEventOptions |
static class |
OnEventOptions.Jsii$Proxy
An implementation for
OnEventOptions |
| Modifier and Type | Method and Description |
|---|---|
static OnEventOptions.Builder |
builder() |
default String |
getDescription()
(experimental) A description of the rule's purpose.
|
default EventPattern |
getEventPattern()
(experimental) Additional restrictions for the event to route to the specified target.
|
default String |
getRuleName()
(experimental) A name for the rule.
|
default IRuleTarget |
getTarget()
(experimental) The target to register for the event.
|
@Stability(value=Experimental) @Nullable default String getDescription()
Default: - No description
@Stability(value=Experimental) @Nullable default EventPattern getEventPattern()
The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering.
Default: - No additional filtering based on an event pattern.
@Stability(value=Experimental) @Nullable default String getRuleName()
Default: AWS CloudFormation generates a unique physical ID.
@Stability(value=Experimental) @Nullable default IRuleTarget getTarget()
Default: - No target is added to the rule. Use `addTarget()` to add a target.
@Stability(value=Experimental) static OnEventOptions.Builder builder()
OnEventOptions.Builder of OnEventOptionsCopyright © 2022. All rights reserved.