Rules
Property configuration rules and includes use behaviors to determine the action taken when specific conditions are met. The options you choose define your behavior and the criteria that trigger the behavior's action.
Each rule format version contains the schema for a set of rules, behaviors, options, and criteria.
For more on how to work with the schema, see Property behaviors.
Update rule format
To update your rule format, pass the required dated version in the property resource.
resource "akamai_property" "update-rule-format" {
name = "my-property"
product_id = "prd_product"
contract_id = "ctr_C-0N7RAC7"
group_id = "grp_12345"
rule_format = "v2023-01-05"
}
Edit rules JSON directly
Make updates or changes directly in your rules' JSON file. When you're done, add your rule updates to your property.
Use rule templates
A rule template is a JSON file containing a single rule that you update and then point to in the rule templates data source.
-
Create a rules directory in your project. This directory will hold your full rules JSON file and any number of templated JSON files split into rule behaviors and children. To keep what file contains which rule, name your template files after the rule.
$ tree ~/terraform/rules rules ├── rules.json │ ├── behaviors │ ├── children
-
Locate the rule(s) you want to update in your
rules.json
file. -
Copy/paste any behaviors you want to update into a new JSON file that will go into the behaviors directory.
-
Copy/paste any children you want to update into a new JSON file that will go into the children directory.
-
Make your updates.
-
Back in your rules' JSON file, point to your template files.
{ "rules": { "name": "default", "children": [ "#include:children/origin-selection.json", "#include:children/offload.json" ], "behaviors": "#include:offload-origin.json", ... }
Updated over 1 year ago