ManagedRule¶
-
class
aws_cdk.aws_config.
ManagedRule
(scope, id, *, identifier, config_rule_name=None, description=None, input_parameters=None, maximum_execution_frequency=None, rule_scope=None)¶ Bases:
aws_cdk.core.Resource
A new managed rule.
- Resource
AWS::Config::ConfigRule
- Parameters
scope (
Construct
) –id (
str
) –identifier (
str
) – The identifier of the AWS managed rule.config_rule_name (
Optional
[str
]) – A name for the AWS Config rule. Default: - CloudFormation generated namedescription (
Optional
[str
]) – A description about this AWS Config rule. Default: - No descriptioninput_parameters (
Optional
[Mapping
[str
,Any
]]) – Input parameter values that are passed to the AWS Config rule. Default: - No input parametersmaximum_execution_frequency (
Optional
[MaximumExecutionFrequency
]) – The maximum frequency at which the AWS Config rule runs evaluations. Default: MaximumExecutionFrequency.TWENTY_FOUR_HOURSrule_scope (
Optional
[RuleScope
]) – Defines which resources trigger an evaluation for an AWS Config rule. Default: - evaluations for the rule are triggered when any resource in the recording group changes.
Methods
-
on_compliance_change
(id, *, description=None, event_pattern=None, rule_name=None, target=None)¶ Defines an 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 (
Optional
[EventPattern
]) – 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 (
Optional
[EventPattern
]) – 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 an 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 (
Optional
[EventPattern
]) – 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
-
to_string
()¶ Returns a string representation of this construct.
- Return type
str
Attributes
-
config_rule_arn
¶ The arn of the rule.
- Attribute
true
- Return type
str
-
config_rule_compliance_type
¶ The compliance status of the rule.
- Attribute
true
- Return type
str
-
config_rule_id
¶ The id of the rule.
- Attribute
true
- Return type
str
-
config_rule_name
¶ The name of the rule.
- Attribute
true
- Return type
str
-
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.
- Return type
-
node
¶ The construct tree node associated with this construct.
- Return type
Static Methods
-
classmethod
from_config_rule_name
(scope, id, config_rule_name)¶ Imports an existing rule.
- Parameters
scope (
Construct
) –id (
str
) –config_rule_name (
str
) – the name of the rule.
- Return type
-
classmethod
is_construct
(x)¶ Return whether the given object is a Construct.
- Parameters
x (
Any
) –- Return type
bool