Forward rewrite match rule
akamai_cloudlets_forward_rewrite_match_rule
Build a match rule JSON object for the forward rewrite cloudlet.
data "akamai_cloudlets_forward_rewrite_match_rule" "my_fr_match_rule" {
match_rules {
name = "my_fr_match_rule"
matches {
case_sensitive = false
check_ips = "CONNECTING_IP XFF_HEADERS"
match_operator = "equals"
match_type = "clientip"
match_value = "123.4.5.6"
negate = false
}
forward_settings {
path_and_qs = "/path"
use_incoming_query_string = true
origin_id = "12345"
}
}
}
output "my_fw_match_rule" {
value = data.akamai_cloudlets_forward_rewrite_match_rule.my_fr_match_rule
}
Changes to Outputs:
+ my_fw_match_rule = {
+ id = "12ab3cde4f5g678h901234567i890123j456k789
+ json = jsonencode(
[
+ {
+ forwardSettings = {
+ originId = "12345"
+ pathAndQS = "/path"
+ useIncomingQueryString = true
}
+ matches = [
+ {
+ caseSensitive = false
+ checkIPs = "CONNECTING_IP XFF_HEADERS"
+ matchOperator = "equals"
+ matchType = "clientip"
+ matchValue = "123.4.5.6"
+ negate = false
},
]
+ name = "my_fr_match_rule"
+ type = "frMatchRule"
},
]
)
+ match_rules = [
+ {
+ disabled = false
+ end = 0
+ forward_settings = [
+ {
+ origin_id = "12345"
+ path_and_qs = "/path"
+ use_incoming_query_string = true
},
]
+ match_url = ""
+ matches = [
+ {
+ case_sensitive = false
+ check_ips = "CONNECTING_IP XFF_HEADERS"
+ match_operator = "equals"
+ match_type = "clientip"
+ match_value = "123.4.5.6"
+ negate = false
+ object_match_value = []
},
]
+ name = "my_fr_match_rule"
+ start = 0
+ type = "frMatchRule"
},
]
}
Arguments
Pass a match_rules
list with the options that best fit your business case. While the match definitions arguments are optional, expected, at a minimum, is the forward_settings
argument.
Use the information in the match options table to build out your rule's matches
criteria.
Argument | Required | Description |
---|---|---|
forward_settings |
✔ | The data used to construct a new request URL if all match conditions are met. When all conditions are met, the edge server returns an HTTP response from the rewritten URL.
|
name |
A human-readable name for your rule. | |
start |
The start time for the match. Value is UTC through seconds. | |
end |
The end time for the match. Value is UTC through seconds. | |
match_url |
The URL that the cloudlet uses to match with the incoming request. | |
disabled |
Whether to disable a rule so it is not evaluated against incoming requests. | |
matches |
The match object definitions list. |
Match options
The options listed are nested within the matches
argument.
All match options are optional.
Argument | Description |
---|---|
match_type |
The type of match used. Value is one of:
|
match_value |
A value that reflects your match type, for example, if you set your match type to countrycode , the value would reflect the match country. |
match_operator |
Compares a string expression with a pattern. Value is one of:
|
case_sensitive |
Whether the match is case sensitive. |
negate |
Whether to negate the match. |
check_ips |
For clientip , continent , countrycode , proxy , and regioncode match types, the part of the request to use as the IP address. Value options:
|
object_match_value |
Use when a rule includes more complex match criteria, like multiple value attributes. Value options:
|
Attributes
Returned is a jsonencoded list of the match rules defined in your query. Set the output type to capture the result based on your need as you use the return in the policy resource.
Updated 8 months ago