Create safety rules - Amazon Route 53 Application Recovery Controller

Create safety rules

The following are examples of requests to create the two types of safety rules, assertion rules and gating rules, and the responses.

The following call provides an example of creating an assertion rule that makes sure that at least one of your routing controls is enabled at any given time.

aws route53-recovery-control-config --region us-west-2 create-safety-rule \ --assertion-rule '{"Name": "TestAssertionRule", "ControlPanelArn": "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx", "WaitPeriodMs": 5000, "AssertedControls": ["arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/def123def123def", "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/ghi456ghi456ghi"], "RuleConfig": {"Threshold": 1, "Type": "ATLEAST", "Inverted": false}}'
{ "Rule": { "ASSERTION": { "Arn": "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/safetyrule/333333444444", "AssertedControls": [ "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/def123def123def", "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/ghi456ghi456ghi"], "ControlPanelArn": "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx", "Name": "TestAssertionRule", "RuleConfig": { "Inverted": false, "Threshold": 1, "Type": "ATLEAST" }, "Status": "PENDING", "WaitPeriodMs": 5000 } } }

The following call provides an example of creating a gating rule that that acts as an overall "on/off" switch for a set of target routing controls in a control panel, to enable or disable the target routing controls from being turned on or off.

aws route53-recovery-control-config --region us-west-2 create-safety-rule \ --gating-rule '{"Name": "TestGatingRule", "ControlPanelArn": "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx", "WaitPeriodMs": 5000, "GatingControls": ["arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/def123def123def"], "TargetControls": ["arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/ghi456ghi456ghi", "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/lmn789lmn789lmn"], "RuleConfig": {"Threshold": 0, "Type": "OR", "Inverted": false}}'
{ "Rule": { "GATING": { "Arn": "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/safetyrule/444444444444", "GatingControls": [ "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/def123def123def" ], "TargetControls": [ "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/ghi456ghi456ghi", "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx/routingcontrol/lmn789lmn789lmn" ], "ControlPanelArn": "arn:aws:route53-recovery-control::888888888888:controlpanel/zzz123yyy456xxx789zzz123yyy456xxx", "Name": "TestGatingRule", "RuleConfig": { "Inverted": false, "Threshold": 0, "Type": "OR" }, "Status": "PENDING", "WaitPeriodMs": 5000 } } }