CfnSafetyRulePropsMixin
- class aws_cdk.mixins_preview.aws_route53recoverycontrol.mixins.CfnSafetyRulePropsMixin(props, *, strategy=None)
Bases:
MixinCreates a safety rule in a control panel in Amazon Route 53 Application Recovery Controller.
Safety rules in Amazon Route 53 Application Recovery Controller let you add safeguards around changing routing control states, and enabling and disabling routing controls, to help prevent unwanted outcomes. Note that the name of a safety rule must be unique within a control panel.
There are two types of safety rules in Route 53 ARC: assertion rules and gating rules.
Assertion rule: An assertion rule enforces that, when you change a routing control state, certain criteria are met. For example, the criteria might be that at least one routing control state is
Onafter the transaction completes so that traffic continues to be directed to at least one cell for the application. This prevents a fail-open scenario.Gating rule: A gating rule lets you configure a gating routing control as an overall on-off switch for a group of routing controls. Or, you can configure more complex gating scenarios, for example, by configuring multiple gating routing controls.
For more information, see Safety rules in the Amazon Route 53 Application Recovery Controller Developer Guide.
- See:
- CloudformationResource:
AWS::Route53RecoveryControl::SafetyRule
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_route53recoverycontrol import mixins as route53recoverycontrol_mixins cfn_safety_rule_props_mixin = route53recoverycontrol_mixins.CfnSafetyRulePropsMixin(route53recoverycontrol_mixins.CfnSafetyRuleMixinProps( assertion_rule=route53recoverycontrol_mixins.CfnSafetyRulePropsMixin.AssertionRuleProperty( asserted_controls=["assertedControls"], wait_period_ms=123 ), control_panel_arn="controlPanelArn", gating_rule=route53recoverycontrol_mixins.CfnSafetyRulePropsMixin.GatingRuleProperty( gating_controls=["gatingControls"], target_controls=["targetControls"], wait_period_ms=123 ), name="name", rule_config=route53recoverycontrol_mixins.CfnSafetyRulePropsMixin.RuleConfigProperty( inverted=False, threshold=123, type="type" ), tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::Route53RecoveryControl::SafetyRule.- Parameters:
props (
Union[CfnSafetyRuleMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['assertionRule', 'controlPanelArn', 'gatingRule', 'name', 'ruleConfig', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AssertionRuleProperty
- class CfnSafetyRulePropsMixin.AssertionRuleProperty(*, asserted_controls=None, wait_period_ms=None)
Bases:
objectAn assertion rule enforces that, when you change a routing control state, that the criteria that you set in the rule configuration is met.
Otherwise, the change to the routing control is not accepted. For example, the criteria might be that at least one routing control state is
Onafter the transaction so that traffic continues to flow to at least one cell for the application. This ensures that you avoid a fail-open scenario.- Parameters:
asserted_controls (
Optional[Sequence[str]]) – The routing controls that are part of transactions that are evaluated to determine if a request to change a routing control state is allowed. For example, you might include three routing controls, one for each of three AWS Regions.wait_period_ms (
Union[int,float,None]) – An evaluation period, in milliseconds (ms), during which any request against the target routing controls will fail. This helps prevent flapping of state. The wait period is 5000 ms by default, but you can choose a custom value.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_route53recoverycontrol import mixins as route53recoverycontrol_mixins assertion_rule_property = route53recoverycontrol_mixins.CfnSafetyRulePropsMixin.AssertionRuleProperty( asserted_controls=["assertedControls"], wait_period_ms=123 )
Attributes
- asserted_controls
The routing controls that are part of transactions that are evaluated to determine if a request to change a routing control state is allowed.
For example, you might include three routing controls, one for each of three AWS Regions.
- wait_period_ms
An evaluation period, in milliseconds (ms), during which any request against the target routing controls will fail.
This helps prevent flapping of state. The wait period is 5000 ms by default, but you can choose a custom value.
GatingRuleProperty
- class CfnSafetyRulePropsMixin.GatingRuleProperty(*, gating_controls=None, target_controls=None, wait_period_ms=None)
Bases:
objectA gating rule verifies that a gating routing control or set of gating routing controls, evaluates as true, based on a rule configuration that you specify, which allows a set of routing control state changes to complete.
For example, if you specify one gating routing control and you set the
Typein the rule configuration toOR, that indicates that you must set the gating routing control toOnfor the rule to evaluate as true; that is, for the gating control switch to be On. When you do that, then you can update the routing control states for the target routing controls that you specify in the gating rule.- Parameters:
gating_controls (
Optional[Sequence[str]]) – An array of gating routing control Amazon Resource Names (ARNs). For a simple on-off switch, specify the ARN for one routing control. The gating routing controls are evaluated by the rule configuration that you specify to determine if the target routing control states can be changed.target_controls (
Optional[Sequence[str]]) – An array of target routing control Amazon Resource Names (ARNs) for which the states can only be updated if the rule configuration that you specify evaluates to true for the gating routing control. As a simple example, if you have a single gating control, it acts as an overall on-off switch for a set of target routing controls. You can use this to manually override automated failover, for example.wait_period_ms (
Union[int,float,None]) – An evaluation period, in milliseconds (ms), during which any request against the target routing controls will fail. This helps prevent flapping of state. The wait period is 5000 ms by default, but you can choose a custom value.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_route53recoverycontrol import mixins as route53recoverycontrol_mixins gating_rule_property = route53recoverycontrol_mixins.CfnSafetyRulePropsMixin.GatingRuleProperty( gating_controls=["gatingControls"], target_controls=["targetControls"], wait_period_ms=123 )
Attributes
- gating_controls
An array of gating routing control Amazon Resource Names (ARNs).
For a simple on-off switch, specify the ARN for one routing control. The gating routing controls are evaluated by the rule configuration that you specify to determine if the target routing control states can be changed.
- target_controls
An array of target routing control Amazon Resource Names (ARNs) for which the states can only be updated if the rule configuration that you specify evaluates to true for the gating routing control.
As a simple example, if you have a single gating control, it acts as an overall on-off switch for a set of target routing controls. You can use this to manually override automated failover, for example.
- wait_period_ms
An evaluation period, in milliseconds (ms), during which any request against the target routing controls will fail.
This helps prevent flapping of state. The wait period is 5000 ms by default, but you can choose a custom value.
RuleConfigProperty
- class CfnSafetyRulePropsMixin.RuleConfigProperty(*, inverted=None, threshold=None, type=None)
Bases:
objectThe rule configuration for an assertion rule.
That is, the criteria that you set for specific assertion controls (routing controls) that specify how many controls must be enabled after a transaction completes.
- Parameters:
inverted (
Union[bool,IResolvable,None]) – Logical negation of the rule. If the rule would usually evaluate true, it’s evaluated as false, and vice versa.threshold (
Union[int,float,None]) – The value of N, when you specify anATLEASTrule type. That is,Thresholdis the number of controls that must be set when you specify anATLEASTtype.type (
Optional[str]) – A rule can be one of the following:ATLEAST,AND, orOR.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_route53recoverycontrol import mixins as route53recoverycontrol_mixins rule_config_property = route53recoverycontrol_mixins.CfnSafetyRulePropsMixin.RuleConfigProperty( inverted=False, threshold=123, type="type" )
Attributes
- inverted
Logical negation of the rule.
If the rule would usually evaluate true, it’s evaluated as false, and vice versa.
- threshold
The value of N, when you specify an
ATLEASTrule type.That is,
Thresholdis the number of controls that must be set when you specify anATLEASTtype.
- type
ATLEAST,AND, orOR.- See:
- Type:
A rule can be one of the following