IRule
- class aws_cdk.aws_config.IRule(*args, **kwds)
Bases:
IResource
,Protocol
Interface representing an AWS Config rule.
Methods
- apply_removal_policy(policy)
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
RemovalPolicy
) –- Return type:
None
- on_compliance_change(id, *, description=None, event_pattern=None, rule_name=None, target=None)
Defines a EventBridge event rule which triggers for rule compliance events.
- Parameters:
id (
str
) –description (
Optional
[str
]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union
[EventPattern
,Dict
[str
,Any
],None
]) – Additional restrictions for the event to route to the specified target. 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.rule_name (
Optional
[str
]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.target (
Optional
[IRuleTarget
]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()
to add a target.
- Return type:
- on_event(id, *, description=None, event_pattern=None, rule_name=None, target=None)
Defines an EventBridge event rule which triggers for rule events.
Use
rule.addEventPattern(pattern)
to specify a filter.- Parameters:
id (
str
) –description (
Optional
[str
]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union
[EventPattern
,Dict
[str
,Any
],None
]) – Additional restrictions for the event to route to the specified target. 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.rule_name (
Optional
[str
]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.target (
Optional
[IRuleTarget
]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()
to add a target.
- Return type:
- on_re_evaluation_status(id, *, description=None, event_pattern=None, rule_name=None, target=None)
Defines a EventBridge event rule which triggers for rule re-evaluation status events.
- Parameters:
id (
str
) –description (
Optional
[str
]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union
[EventPattern
,Dict
[str
,Any
],None
]) – Additional restrictions for the event to route to the specified target. 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.rule_name (
Optional
[str
]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.target (
Optional
[IRuleTarget
]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()
to add a target.
- Return type:
Attributes
- config_rule_name
The name of the rule.
- Attribute:
true
- env
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- node
The construct tree node for this construct.
- stack
The stack in which this resource is defined.