---
updatedAt: 2026-03-01T18:39:13.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/terraform/llms.txt
---

# API prioritization match rule

akamai_cloudlets_api_prioritization_match_rule

Build a match rule JSON object for the API prioritization cloudlet.

```json Query
data "akamai_cloudlets_api_prioritization_match_rule" "my_ap_match_rule" {
    match_rules {
        name = "my_ap_rule"
        disabled = false
        match_url = "my_ap_rule_example.com"
        pass_through_percent = 100
        matches {
            case_sensitive = true
            match_type = "method"
            match_operator = "equals"
            negate = false
            object_match_value {
                type = "simple"
                value = ["POST"]
            }
        }
    }
}

output "my_ap_match_rule" {
  value = data.akamai_cloudlets_api_prioritization_match_rule.my_ap_match_rule
}
```
```json Standard output
my_ap_match_rule = {
      id          = "12ab3cde4f5g678h901234567i890123j456k789"
      json        = jsonencode(
            [
              {
                  matchURL           = "my_ap_rule_example.com"
                  matches            = [
                      {
                          caseSensitive    = true
                          matchOperator    = "equals"
                          matchType        = "method"
                          negate           = false
                          objectMatchValue = {
                              type  = "simple"
                              value = [
                                  "POST",
                                ]
                            }
                        },
                    ]
                  name               = "my_ap_rule"
                  passThroughPercent = 100
                  type               = "apMatchRule"
                },
            ]
        )
      match_rules = [
          {
              disabled             = false
              end                  = 0
              match_url            = "my_rule_example.com"
              matches              = [
                  {
                      case_sensitive     = true
                      check_ips          = ""
                      match_operator     = "equals"
                      match_type         = "method"
                      match_value        = ""
                      negate             = false
                      object_match_value = [
                          {
                              name                = ""
                              name_case_sensitive = false
                              name_has_wildcard   = false
                              options             = []
                              type                = "simple"
                              value               = [
                                  "POST",
                                ]
                            },
                        ]
                    },
                ]
              name                 = "my_ap_rule"
              pass_through_percent = 100
              start                = 0
              type                 = "apMatchRule"
            },
        ]
    }
```

## 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 `pass_through_percent` argument.

Use the information in the match options table to build out your rule's `matches` criteria.

<table>
  <thead>
    <th>Argument</th>
    <th>Required</th>
    <th>Description</th>
  </thead>
  <tbody>
    <tr>
      <td><code>pass_through_percent</code></td>
      <td class="rqcent">&#10004;</td>
      <td>The percent of requests that pass through to the origin. Value options are:
        <ul>
          <li><code>0.0</code>-<code>99.0</code>.</li>
          <li><code>100</code> sets all requests to pass through.</li>
          <li><code>-1</code> sends all requests to the waiting room.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><code>name</code></td>
      <td></td>
      <td>A human-readable name for your rule.</td>
    </tr>
    <tr>
      <td><code>start</code></td>
      <td></td>
      <td>The start time for the match. Value is UTC through seconds.</td>
    </tr>
    <tr>
      <td><code>end</code></td>
      <td></td>
      <td>The end time for the match. Value is UTC through seconds.</td>
    </tr>
    <tr>
      <td><code>match_url</code></td>
      <td></td>
      <td>The URL that the cloudlet uses to match with the incoming request.</td>
    </tr>
    <tr>
      <td><code>disabled</code></td>
      <td></td>
      <td>Whether to disable a rule so it is not evaluated against incoming requests.</td>
    </tr>
    <tr>
      <td><code>matches</code></td>
      <td></td>
      <td>The match object definitions list.</td>
    </tr>
  </tbody>
</table>

### Match options

The options listed are nested within the `matches` argument.

All match options are optional.

<table>
  <thead>
    <th>Argument</th>
    <th>Description</th>
  </thead>
  <tbody>
    <tr>
      <td><code>match_type</code></td>
      <td>The type of match used. Value is one of:
        <ul>
          <li><code>header</code></li>
          <li><code>hostname</code></li>
          <li><code>path</code></li>
          <li><code>extension</code></li>
          <li><code>query</code></li>
          <li><code>cookie</code></li>
          <li><code>deviceCharacteristics</code></li>
          <li><code>clientip</code></li>
          <li><code>continent</code></li>
          <li><code>countrycode</code></li>
          <li><code>regioncode</code></li>
          <li><code>protocol</code></li>
          <li><code>method</code></li>
          <li><code>proxy</code></li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><code>match_value</code></td>
      <td>A value that reflects your match type, for example, if you set your match type to <code>countrycode</code>, the value would reflect the match country.</td>
    </tr>
    <tr>
      <td><code>match_operator</code></td>
      <td>Compares a string expression with a pattern. Value is one of:
        <ul>
          <li><code>contains</code></li>
          <li><code>exists</code></li>
          <li><code>equals</code></li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><code>case_sensitive</code></td>
      <td>Whether the match is case sensitive.</td>
    </tr>
    <tr>
      <td><code>negate</code></td>
      <td>Whether to negate the match.</td>
    </tr>
    <tr>
      <td><code>check_ips</code></td>
      <td>For <code>clientip</code>, <code>continent</code>, <code>countrycode</code>, <code>proxy</code>, and <code>regioncode</code> match types, the part of the request to use as the IP address. Value options:
        <ul>
          <li><code>CONNECTING_IP</code></li>
          <li><code>XFF_HEADERS</code></li>
          <li>You can use both separated by a space. When both values are included, the connecting IP address is evaluated first.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><code>object_match_value</code></td>
      <td>Use when a rule includes more complex match criteria, like multiple value attributes. Value options:
        <ul>
          <li><code>name</code>. One of <code>cookie</code>, <code>header</code>, <code>parameter</code>, or <code>query</code>.</li>
          <li><code>type</code>. Required. The type of list, either <code>object</code> or <code>simple</code>.</li>
          <li><code>name_case_sensitive</code>. Whether the evaluation of the <code>name</code> argument is case sensitive.</li>
          <li><code>name_has_wildcard</code>. Whether the <code>name</code> argument includes wildcards.</li>
          <li><code>options</code>. If you set the <code>type</code> argument to <code>object</code>, use this to list the values on which to match.
            <ul>
              <li><code>value</code>. The values in the incoming request on which to match.</li>
              <li><code>value_has_wildcard</code>. Whether the <code>value</code> argument includes wildcards.</li>
              <li><code>value_case_sensitive</code>. Whether the evaluation of the <code>value</code> argument is case sensitive.</li>
              <li><code>value_escaped</code>. Whether the compared <code>value</code> argument can be an escaped form.</li>
            </ul>
          </li>
          <li><code>value</code>. If you set the <code>type</code> argument to <code>simple</code>, provide the values in the incoming request on which to match.</li>
        </ul>
      </td>
    </tr>
  </tbody>
</table>

## 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.

# Sibling pages

* [Application load balancer](https://techdocs.akamai.com/terraform/docs/cl-ds-application-load-balancer.md)
* [Audience segmentation match rule](https://techdocs.akamai.com/terraform/docs/cl-ds-audience-segmentation-match-rule.md)
* [Edge redirector match rule](https://techdocs.akamai.com/terraform/docs/cl-ds-edge-redirector-match-rule.md)
* [Forward rewrite match rule](https://techdocs.akamai.com/terraform/docs/cl-ds-forward-rewrite-match-rule.md)
* [Load balancer match rule](https://techdocs.akamai.com/terraform/docs/cl-ds-load-balancer-match-rule.md)
* [Phased release match rule](https://techdocs.akamai.com/terraform/docs/cl-ds-phased-release-match-rule.md)
* [Policy](https://techdocs.akamai.com/terraform/docs/cl-ds-policy.md)
* [Policy activation](https://techdocs.akamai.com/terraform/docs/cl-ds-policy-activation.md)
* [Request control match rule](https://techdocs.akamai.com/terraform/docs/cl-ds-request-control-match-rule.md)
* [Shared policy](https://techdocs.akamai.com/terraform/docs/cl-ds-shared-policy.md)
* [Visitor prioritization match rule](https://techdocs.akamai.com/terraform/docs/cl-ds-visitor-prioritization-match-rule.md)