CloudFormationStackDriftDetectionCheck

class aws_cdk.aws_config.CloudFormationStackDriftDetectionCheck(scope, id, *, own_stack_only=None, role=None, config_rule_name=None, description=None, input_parameters=None, maximum_execution_frequency=None)

Bases: aws_cdk.aws_config.ManagedRule

Checks whether your CloudFormation stacks’ actual configuration differs, or has drifted, from its expected configuration.

see :see: https://docs.aws.amazon.com/config/latest/developerguide/cloudformation-stack-drift-detection-check.html stability :stability: experimental resource: :resource:: AWS::Config::ConfigRule

__init__(scope, id, *, own_stack_only=None, role=None, config_rule_name=None, description=None, input_parameters=None, maximum_execution_frequency=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • props

  • own_stack_only (Optional[bool]) – Whether to check only the stack where this rule is deployed. Default: false

  • role (Optional[IRole]) – The IAM role to use for this rule. It must have permissions to detect drift for AWS CloudFormation stacks. Ensure to attach config.amazonaws.com trusted permissions and ReadOnlyAccess policy permissions. For specific policy permissions, refer to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html. Default: a role will be created

  • config_rule_name (Optional[str]) – A name for the AWS Config rule. Default: a CloudFormation generated name

  • description (Optional[str]) – A description about this AWS Config rule. Default: no description

  • input_parameters (Optional[Mapping[str, Any]]) – Input parameter values that are passed to the AWS Config rule. Default: no input parameters

  • maximum_execution_frequency (Optional[MaximumExecutionFrequency]) – The maximum frequency at which the AWS Config rule runs evaluations. Default: 24 hours

stability :stability: experimental

Return type

None

Methods

on_compliance_change(id, *, description=None, event_pattern=None, rule_name=None, target=None)

Defines a CloudWatch event rule which triggers for rule compliance events.

Parameters
  • id (str) –

  • options

  • description (Optional[str]) – A description of the rule’s purpose. Default: - No description

  • event_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. Use addTarget() to add a target.

stability :stability: experimental

Return type

Rule

on_event(id, *, description=None, event_pattern=None, rule_name=None, target=None)

Defines a CloudWatch event rule which triggers for rule events.

Use rule.addEventPattern(pattern) to specify a filter.

Parameters
  • id (str) –

  • options

  • description (Optional[str]) – A description of the rule’s purpose. Default: - No description

  • event_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. Use addTarget() to add a target.

stability :stability: experimental

Return type

Rule

on_re_evaluation_status(id, *, description=None, event_pattern=None, rule_name=None, target=None)

Defines a CloudWatch event rule which triggers for rule re-evaluation status events.

Parameters
  • id (str) –

  • options

  • description (Optional[str]) – A description of the rule’s purpose. Default: - No description

  • event_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. Use addTarget() to add a target.

stability :stability: experimental

Return type

Rule

scope_to_resource(type, identifier=None)

Restrict scope of changes to a specific resource.

Parameters
  • type (str) – the resource type.

  • identifier (Optional[str]) – the resource identifier.

see :see: https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources stability :stability: experimental

Return type

None

scope_to_resources(*types)

Restrict scope of changes to specific resource types.

Parameters

types (str) – resource types.

see :see: https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources stability :stability: experimental

Return type

None

scope_to_tag(key, value=None)

Restrict scope of changes to a specific tag.

Parameters
  • key (str) – the tag key.

  • value (Optional[str]) – the tag value.

stability :stability: experimental

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

config_rule_arn

The arn of the rule.

stability :stability: experimental attribute: :attribute:: true

Return type

str

config_rule_compliance_type

The compliance status of the rule.

stability :stability: experimental attribute: :attribute:: true

Return type

str

config_rule_id

The id of the rule.

stability :stability: experimental attribute: :attribute:: true

Return type

str

config_rule_name

The name of the rule.

stability :stability: experimental attribute: :attribute:: true

Return type

str

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

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.

stability :stability: experimental

Return type

IRule

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool