CreateSafetyRule, UpdateSafetyRule - Amazon Route 53 Application Recovery Controller

CreateSafetyRule, UpdateSafetyRule

URI

/safetyrule

HTTP methods

POST

Operation ID: CreateSafetyRule

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.

Note that the name of a safety rule must be unique within a control panel.

For more information, see Safety rules in the Amazon Route 53 Application Recovery Controller Developer Guide.

Responses
Status codeResponse modelDescription
200CreateSafetyRuleResponse

200 response - Success.

400ValidationException

400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you used parameters together incorrectly.

500InternalServerException

500 response - InternalServiceError. Temporary service error. Retry the request.

PUT

Operation ID: UpdateSafetyRule

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.

Responses
Status codeResponse modelDescription
200UpdateSafetyRuleResponse

200 response - Success.

400ValidationException

400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you used parameters together incorrectly.

404ResourceNotFoundException

404 response - MalformedQueryString. The query string contains a syntax error or resource not found.

500InternalServerException

500 response - InternalServiceError. Temporary service error. Retry the request.

OPTIONS

Responses
Status codeResponse modelDescription
200None

200 response - Success.

Schemas

Request bodies

{ "AssertionRule": { "ControlPanelArn": "string", "AssertedControls": [ "string" ], "RuleConfig": { "Type": enum, "Inverted": boolean, "Threshold": integer }, "WaitPeriodMs": integer, "Name": "string" }, "ClientToken": "string", "GatingRule": { "TargetControls": [ "string" ], "ControlPanelArn": "string", "GatingControls": [ "string" ], "RuleConfig": { "Type": enum, "Inverted": boolean, "Threshold": integer }, "WaitPeriodMs": integer, "Name": "string" }, "Tags": [ { "Value": "string", "Key": "string" } ] }
{ "GatingRuleUpdate": { "SafetyRuleArn": "string", "WaitPeriodMs": integer, "Name": "string" }, "AssertionRuleUpdate": { "SafetyRuleArn": "string", "WaitPeriodMs": integer, "Name": "string" } }

Response bodies

{ "AssertionRule": { "Status": enum, "ControlPanelArn": "string", "AssertedControls": [ "string" ], "SafetyRuleArn": "string", "RuleConfig": { "Type": enum, "Inverted": boolean, "Threshold": integer }, "WaitPeriodMs": integer, "Name": "string" }, "GatingRule": { "Status": enum, "TargetControls": [ "string" ], "ControlPanelArn": "string", "GatingControls": [ "string" ], "SafetyRuleArn": "string", "RuleConfig": { "Type": enum, "Inverted": boolean, "Threshold": integer }, "WaitPeriodMs": integer, "Name": "string" } }
{ "AssertionRule": { "Status": enum, "ControlPanelArn": "string", "AssertedControls": [ "string" ], "SafetyRuleArn": "string", "RuleConfig": { "Type": enum, "Inverted": boolean, "Threshold": integer }, "WaitPeriodMs": integer, "Name": "string" }, "GatingRule": { "Status": enum, "TargetControls": [ "string" ], "ControlPanelArn": "string", "GatingControls": [ "string" ], "SafetyRuleArn": "string", "RuleConfig": { "Type": enum, "Inverted": boolean, "Threshold": integer }, "WaitPeriodMs": integer, "Name": "string" } }
{ "message": "string" }
{ "message": "string" }
{ "message": "string" }

Properties

AssertionRule

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.

PropertyTypeRequiredDescription
AssertedControls

Array of type string

True

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.

ControlPanelArn

string

True

The Amazon Resource Name (ARN) of the control panel.

Name

string

Pattern: ^\S+$

MinLength: 1

MaxLength: 64

True

Name of the assertion rule. You can use any non-white space character in the name except the following: & > < ' (single quote) " (double quote) ; (semicolon)

RuleConfig

RuleConfig

True

The criteria that you set for specific assertion routing controls (AssertedControls) that designate how many routing control states must be ON as the result of a transaction. For example, if you have three assertion routing controls, you might specify atleast 2 for your rule configuration. This means that at least two assertion routing control states must be ON, so that at least two AWS Regions have traffic flowing to them.

SafetyRuleArn

string

True

The Amazon Resource Name (ARN) of the assertion rule.

Status

Status

True

The deployment status of an assertion rule. Status can be one of the following: PENDING, DEPLOYED, PENDING_DELETION.

WaitPeriodMs

integer

Format: int32

True

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.

AssertionRuleUpdate

An update to an assertion rule. You can update the name or the evaluation period (wait period). If you don't specify one of the items to update, the item is unchanged.

PropertyTypeRequiredDescription
Name

string

Pattern: ^\S+$

MinLength: 1

MaxLength: 64

True

The name of the assertion rule. The name must be unique within a control panel. You can use any non-white space character in the name except the following: & > < ' (single quote) " (double quote) ; (semicolon)

SafetyRuleArn

string

True

The Amazon Resource Name (ARN) of the assertion rule.

WaitPeriodMs

integer

Format: int32

True

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.

CreateSafetyRuleRequest

Request to create a safety rule. You can create either an assertion rule or a gating rule with a CreateSafetyRuleRequest call. To learn more, Safety rules in the Amazon Route 53 Application Recovery Controller Developer Guide.

PropertyTypeRequiredDescription
AssertionRule

NewAssertionRule

False

The assertion rule requested.

ClientToken

string

MaxLength: 64

False

A unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request with an action, specify a client token in the request.

GatingRule

NewGatingRule

False

The gating rule requested.

Tags

Array of type Tag

False

The tags associated with the safety rule.

CreateSafetyRuleResponse

The result of a successful CreateSafetyRule request.

PropertyTypeRequiredDescription
AssertionRule

AssertionRule

False

The assertion rule created.

GatingRule

GatingRule

False

The gating rule created.

GatingRule

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.

PropertyTypeRequiredDescription
ControlPanelArn

string

True

The Amazon Resource Name (ARN) of the control panel.

GatingControls

Array of type string

True

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.

Name

string

Pattern: ^\S+$

MinLength: 1

MaxLength: 64

True

The name of the gating rule. You can use any non-white space character in the name except the following: & > < ' (single quote) " (double quote) ; (semicolon)

RuleConfig

RuleConfig

True

The criteria that you set for gating routing controls that designate how many of the routing control states must be ON to allow you to update target routing control states.

SafetyRuleArn

string

True

The Amazon Resource Name (ARN) of the gating rule.

Status

Status

True

The deployment status of a gating rule. Status can be one of the following: PENDING, DEPLOYED, PENDING_DELETION.

TargetControls

Array of type string

True

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.

WaitPeriodMs

integer

Format: int32

True

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.

GatingRuleUpdate

Update to a gating rule. You can update the name or the evaluation period (wait period). If you don't specify one of the items to update, the item is unchanged.

PropertyTypeRequiredDescription
Name

string

Pattern: ^\S+$

MinLength: 1

MaxLength: 64

True

The name of the gating rule. The name must be unique within a control panel. Note that only ASCII characters are supported for gating rule names.

SafetyRuleArn

string

True

The Amazon Resource Name (ARN) of the gating rule.

WaitPeriodMs

integer

Format: int32

True

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.

InternalServerException

500 response - InternalServiceError. Temporary service error. Retry the request.

PropertyTypeRequiredDescription
message

string

True

NewAssertionRule

A new assertion rule for a control panel.

PropertyTypeRequiredDescription
AssertedControls

Array of type string

True

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.

ControlPanelArn

string

True

The Amazon Resource Name (ARN) for the control panel.

Name

string

Pattern: ^\S+$

MinLength: 1

MaxLength: 64

True

The name of the assertion rule. The name must be unique within a control panel. Note that only ASCII characters are supported for control panel names, and each name must be unique within a control panel.

RuleConfig

RuleConfig

True

The criteria that you set for specific assertion controls (routing controls) that designate how many control states must be ON as the result of a transaction. For example, if you have three assertion controls, you might specify ATLEAST 2 for your rule configuration. This means that at least two assertion controls must be ON, so that at least two AWS Regions have traffic flowing to them.

WaitPeriodMs

integer

Format: int32

True

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.

NewGatingRule

A new gating rule for a control panel. To learn more, Safety rules in the Amazon Route 53 Application Recovery Controller Developer Guide.

PropertyTypeRequiredDescription
ControlPanelArn

string

True

The Amazon Resource Name (ARN) of the control panel.

GatingControls

Array of type string

True

The gating controls for the new gating rule. That is, routing controls that are evaluated by the rule configuration that you specify. To learn more, Safety rules in the Amazon Route 53 Application Recovery Controller Developer Guide.

Name

string

Pattern: ^\S+$

MinLength: 1

MaxLength: 64

True

The name for the new gating rule.

RuleConfig

RuleConfig

True

The criteria that you set for specific gating controls (routing controls) that designate how many control states must be ON to allow you to change (set or unset) the target control states.

TargetControls

Array of type string

True

Routing controls that can only be set or unset if the specified RuleConfig evaluates to true for the specified GatingControls. For example, say you have three gating controls, one for each of three AWS Regions. Now you specify ATLEAST 2 as your RuleConfig. With these settings, you can only change (set or unset) the routing controls that you have specified as TargetControls if that rule evaluates to true.

In other words, your ability to change the routing controls that you have specified as TargetControls is gated by the rule that you set for the routing controls in GatingControls.

WaitPeriodMs

integer

Format: int32

True

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.

ResourceNotFoundException

404 response - MalformedQueryString. The query string contains a syntax error or resource not found.

PropertyTypeRequiredDescription
message

string

True

RuleConfig

The rule configuration for an assertion rule. That is, the criteria that you set for specific assertion controls (routing controls) that specify how many control states must be ON after a transaction completes.

PropertyTypeRequiredDescription
Inverted

boolean

True

Logical negation of the rule. If the rule would usually evaluate true, it's evaluated as false, and vice versa.

Threshold

integer

Format: int32

True

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

RuleType

True

A rule can be one of the following: ATLEAST, AND, or OR.

RuleType

An enumerated type that determines how the evaluated rules are processed. RuleType can be one of the following:

ATLEAST - At least N routing controls must be set. You specify N as the Threshold in the rule configuration.

AND - All routing controls must be set. This is a shortcut for "At least N," where N is the total number of controls in the rule.

OR - Any control must be set. This is a shortcut for "At least N," where N is 1.

  • ATLEAST

  • AND

  • OR

Status

The deployment status of a resource. Status can be one of the following:

PENDING: Amazon Route 53 Application Recovery Controller is creating the resource.

DEPLOYED: The resource is deployed and ready to use.

PENDING_DELETION: Amazon Route 53 Application Recovery Controller is deleting the resource.

  • PENDING

  • DEPLOYED

  • PENDING_DELETION

Tag

A tag that you add to a resource.

PropertyTypeRequiredDescription
Key

string

MinLength: 1

MaxLength: 128

True

The key for a tag.

Value

string

MaxLength: 256

True

The value for a tag.

UpdateSafetyRuleRequest

Request to update a safety rule. A safety rule can be an assertion rule or a gating rule.

PropertyTypeRequiredDescription
AssertionRuleUpdate

AssertionRuleUpdate

False

The assertion rule to update.

GatingRuleUpdate

GatingRuleUpdate

False

The gating rule to update.

UpdateSafetyRuleResponse

The result of a successful UpdateSafetyRule request.

PropertyTypeRequiredDescription
AssertionRule

AssertionRule

False

The assertion rule updated.

GatingRule

GatingRule

False

The gating rule updated.

ValidationException

400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you might have used parameters together incorrectly.

PropertyTypeRequiredDescription
message

string

True

See also

For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

CreateSafetyRule

UpdateSafetyRule