GuideReference
Guide

Rate policy

akamai_appsec_rate_policy

Create, modify, or delete a rate policy for your security configuration.

Rate policies monitor and moderate the number and rate of all the requests you receive to protect your website from dramatic and unexpected traffic surges. See Rate policy for details of its properties and property values.

resource "akamai_appsec_rate_policy" "my-rate-policy" {
  config_id   = 12345
  rate_policy = jsonencode(
    {
      "additionalMatchOptions": [
          {
            "positiveMatch": true,
            "type": "RequestMethodCondition",
            "values": [
                "POST"
              ]
          }
        ],
      "averageThreshold": 3,
      "burstThreshold": 5,
      "clientIdentifier": "ip",
      "counterType": "per_edge",
      "description": "Mitigating HTTP flood attacks using POST requests",
      "id": 12345,
      "matchType": "path",
      "name": "POST Page Requests",
      "pathMatchType": "Custom",
      "pathUriPositiveMatch": true,
      "requestType": "ClientRequest",
      "sameActionOnIpv": false,
      "sameActionOnIpv6": true,
      "type": "WAF"
    }
  )
}
resource "akamai_appsec_rate_policy" "my-rate-policy" {
  config_id   = 12345
  rate_policy = file("${path.module}/rate_policy.json")
}

Arguments

Pass your configuration ID and the definition of your rate policy to create or update your resource.

ArgumentRequiredDescription
config_idYour security configuration's ID.
rate_policyA JSON-formatted definition of your rate policy.

Attributes

There is no default standard output. Upon creation, the last line of the process log contains a success message.

Adding an output block returns the rate_policy_id along with your rate_policy definition.