safety_rules
Creates, updates, deletes, gets or lists a safety_rules resource.
Overview
| Name | safety_rules |
| Type | Resource |
| Id | aws.route53_recovery_control_config.safety_rules |
Fields
The following fields are returned by SELECT queries:
- describe_safety_rule
- list_safety_rules
| Name | Datatype | Description |
|---|---|---|
assertion_rule | object | The assertion rule in the response. |
gating_rule | object | The gating rule in the response. |
| Name | Datatype | Description |
|---|---|---|
assertion | object | An assertion rule enforces that, when a routing control state is changed, the criteria set by the rule configuration is met. Otherwise, the change to the routing control state 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. |
gating | 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. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_safety_rule | select | safety_rule_arn, region | Returns information about a safety rule. | |
list_safety_rules | select | control_panel_arn, region | MaxResults, NextToken | List the safety rules (the assertion rules and gating rules) that you've defined for the routing controls in a control panel. |
create_safety_rule | insert | region | Creates a safety rule in a control panel. Safety rules let you add safeguards around changing routing control states, and for enabling and disabling routing controls, to help prevent unexpected outcomes. There are two types of safety rules: assertion rules and gating rules. Assertion rule: An assertion rule enforces that, when you change a routing control state, that a certain criteria is met. 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. 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. | |
update_safety_rule | update | region | Update a safety rule (an assertion rule or gating rule). You can only update the name and the waiting period for a safety rule. To make other updates, delete the safety rule and create a new one. | |
delete_safety_rule | delete | safety_rule_arn, region | Deletes a safety rule. /> |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
control_panel_arn | string | The Amazon Resource Name (ARN) of the control panel. |
region | string | AWS region (default: us-east-1) |
safety_rule_arn | string | The ARN of the safety rule. |
MaxResults | integer | The number of objects that you want to return with this call. |
NextToken | string | The token that identifies which batch of results you want to see. |
SELECT examples
- describe_safety_rule
- list_safety_rules
Returns information about a safety rule.
SELECT
assertion_rule,
gating_rule
FROM aws.route53_recovery_control_config.safety_rules
WHERE safety_rule_arn = '{{ safety_rule_arn }}' -- required
AND region = '{{ region }}' -- required
;
List the safety rules (the assertion rules and gating rules) that you've defined for the routing controls in a control panel.
SELECT
assertion,
gating
FROM aws.route53_recovery_control_config.safety_rules
WHERE control_panel_arn = '{{ control_panel_arn }}' -- required
AND region = '{{ region }}' -- required
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
INSERT examples
- create_safety_rule
- Manifest
Creates a safety rule in a control panel. Safety rules let you add safeguards around changing routing control states, and for enabling and disabling routing controls, to help prevent unexpected outcomes. There are two types of safety rules: assertion rules and gating rules. Assertion rule: An assertion rule enforces that, when you change a routing control state, that a certain criteria is met. 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. 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.
INSERT INTO aws.route53_recovery_control_config.safety_rules (
AssertionRule,
ClientToken,
GatingRule,
Tags,
region
)
SELECT
'{{ AssertionRule }}',
'{{ ClientToken }}',
'{{ GatingRule }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
assertion_rule,
gating_rule
;
# Description fields are for documentation purposes
- name: safety_rules
props:
- name: region
value: "{{ region }}"
description: Required parameter for the safety_rules resource.
- name: AssertionRule
description: |
A new assertion rule for a control panel.
value:
AssertedControls:
- "{{ AssertedControls }}"
ControlPanelArn: "{{ ControlPanelArn }}"
Name: "{{ Name }}"
RuleConfig:
Inverted: {{ Inverted }}
Threshold: {{ Threshold }}
Type: "{{ Type }}"
WaitPeriodMs: {{ WaitPeriodMs }}
- name: ClientToken
value: "{{ ClientToken }}"
- name: GatingRule
description: |
A new gating rule for a control panel.
value:
ControlPanelArn: "{{ ControlPanelArn }}"
GatingControls:
- "{{ GatingControls }}"
Name: "{{ Name }}"
RuleConfig:
Inverted: {{ Inverted }}
Threshold: {{ Threshold }}
Type: "{{ Type }}"
TargetControls:
- "{{ TargetControls }}"
WaitPeriodMs: {{ WaitPeriodMs }}
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- update_safety_rule
Update a safety rule (an assertion rule or gating rule). You can only update the name and the waiting period for a safety rule. To make other updates, delete the safety rule and create a new one.
UPDATE aws.route53_recovery_control_config.safety_rules
SET
AssertionRuleUpdate = '{{ AssertionRuleUpdate }}',
GatingRuleUpdate = '{{ GatingRuleUpdate }}'
WHERE
region = '{{ region }}' --required
RETURNING
assertion_rule,
gating_rule;
DELETE examples
- delete_safety_rule
Deletes a safety rule. />
DELETE FROM aws.route53_recovery_control_config.safety_rules
WHERE safety_rule_arn = '{{ safety_rule_arn }}' --required
AND region = '{{ region }}' --required
;