Class CustomPolicy
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.config.CustomPolicy
- All Implemented Interfaces:
IResource
,IRule
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:05.735Z")
@Stability(Stable)
public class CustomPolicy
extends Resource
implements IRule
A new custom policy.
Example:
String samplePolicyText = "\n# This rule checks if point in time recovery (PITR) is enabled on active Amazon DynamoDB tables\nlet status = ['ACTIVE']\n\nrule tableisactive when\n resourceType == \"AWS::DynamoDB::Table\" {\n configuration.tableStatus == %status\n}\n\nrule checkcompliance when\n resourceType == \"AWS::DynamoDB::Table\"\n tableisactive {\n let pitr = supplementaryConfiguration.ContinuousBackupsDescription.pointInTimeRecoveryDescription.pointInTimeRecoveryStatus\n %pitr == \"ENABLED\"\n}\n"; CustomPolicy.Builder.create(this, "Custom") .policyText(samplePolicyText) .enableDebugLog(true) .ruleScope(RuleScope.fromResources(List.of(ResourceType.DYNAMODB_TABLE))) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.config.IRule
IRule.Jsii$Default, IRule.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
CustomPolicy
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CustomPolicy
(software.amazon.jsii.JsiiObjectRef objRef) CustomPolicy
(software.constructs.Construct scope, String id, CustomPolicyProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IRule
fromConfigRuleName
(software.constructs.Construct scope, String id, String configRuleName) Imports an existing rule.The arn of the rule.The compliance status of the rule.The id of the rule.The name of the rule.protected Boolean
protected Boolean
protected RuleScope
Defines an EventBridge event rule which triggers for rule compliance events.onComplianceChange
(String id, OnEventOptions options) Defines an EventBridge event rule which triggers for rule compliance events.Defines an EventBridge event rule which triggers for rule events.onEvent
(String id, OnEventOptions options) Defines an EventBridge event rule which triggers for rule events.Defines an EventBridge event rule which triggers for rule re-evaluation status events.onReEvaluationStatus
(String id, OnEventOptions options) Defines an EventBridge event rule which triggers for rule re-evaluation status events.protected void
setIsCustomWithChanges
(Boolean value) protected void
setIsManaged
(Boolean value) protected void
setRuleScope
(RuleScope value) Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
CustomPolicy
protected CustomPolicy(software.amazon.jsii.JsiiObjectRef objRef) -
CustomPolicy
protected CustomPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CustomPolicy
@Stability(Stable) public CustomPolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CustomPolicyProps 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 interfaceIRule
- Parameters:
id
- This parameter is required.options
-
-
onComplianceChange
Defines an EventBridge event rule which triggers for rule compliance events.- Specified by:
onComplianceChange
in interfaceIRule
- 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. -
onEvent
Defines an EventBridge event rule which triggers for rule events.Use
rule.addEventPattern(pattern)
to specify a filter. -
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 interfaceIRule
- Parameters:
id
- This parameter is required.options
-
-
onReEvaluationStatus
Defines an EventBridge event rule which triggers for rule re-evaluation status events.- Specified by:
onReEvaluationStatus
in interfaceIRule
- Parameters:
id
- This parameter is required.
-
getConfigRuleArn
The arn of the rule. -
getConfigRuleComplianceType
The compliance status of the rule. -
getConfigRuleId
The id of the rule. -
getConfigRuleName
The name of the rule.- Specified by:
getConfigRuleName
in interfaceIRule
-
getIsCustomWithChanges
-
setIsCustomWithChanges
-
getIsManaged
-
setIsManaged
-
getRuleScope
-
setRuleScope
-