CfnSafetyRulePropsMixin

class aws_cdk.mixins_preview.aws_route53recoverycontrol.mixins.CfnSafetyRulePropsMixin(props, *, strategy=None)

Bases: Mixin

Creates 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 On after 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html

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:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

AssertionRuleProperty

class CfnSafetyRulePropsMixin.AssertionRuleProperty(*, asserted_controls=None, wait_period_ms=None)

Bases: object

An 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 On after 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-assertionrule.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-assertionrule.html#cfn-route53recoverycontrol-safetyrule-assertionrule-assertedcontrols

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-assertionrule.html#cfn-route53recoverycontrol-safetyrule-assertionrule-waitperiodms

GatingRuleProperty

class CfnSafetyRulePropsMixin.GatingRuleProperty(*, gating_controls=None, target_controls=None, wait_period_ms=None)

Bases: object

A 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 Type in the rule configuration to OR , that indicates that you must set the gating routing control to On for 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule-gatingcontrols

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule-targetcontrols

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule-waitperiodms

RuleConfigProperty

class CfnSafetyRulePropsMixin.RuleConfigProperty(*, inverted=None, threshold=None, type=None)

Bases: object

The 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 an ATLEAST rule type. That is, Threshold is the number of controls that must be set when you specify an ATLEAST type.

  • type (Optional[str]) – A rule can be one of the following: ATLEAST , AND , or OR .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html#cfn-route53recoverycontrol-safetyrule-ruleconfig-inverted

threshold

The value of N, when you specify an ATLEAST rule type.

That is, Threshold is the number of controls that must be set when you specify an ATLEAST type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html#cfn-route53recoverycontrol-safetyrule-ruleconfig-threshold

type

ATLEAST , AND , or OR .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html#cfn-route53recoverycontrol-safetyrule-ruleconfig-type

Type:

A rule can be one of the following