GuideReference
TrainingSupportCommunity
Guide

Policy

akamai_cloudlets_policy

Create and update a cloudlet policy.

resource "akamai_cloudlets_policy" "my_cloudlet_policy" {
  name          = "my_cloudlet_policy
  cloudlet_code = "ER"
  description   = "New Edge redirector policy"
  group_id      = "12345"
  timeouts {
    default = "1h"
  }
  match_rules   = <<-EOF
  [
    {
      "name": "rule1",
      "type": "erMatchRule",
      "useRelativeUrl": "none",
      "statusCode": 301,
      "redirectURL": "https://my_er_cloudlet.com",
      "matchURL": "my_er_cloudlet.com",
      "useIncomingQueryString": false,
      "useIncomingSchemeAndHost": false
    },
    {
      "name": "my_er_match_rule",
      "type": "erMatchRule",
      "matches": [
        {
          "matchType": "path",
          "matchValue": "/my_cloudlet.html",
          "matchOperator": "equals",
          "caseSensitive": false,
          "negate": false
        }
      ],
      "useRelativeUrl": "copy_scheme_hostname",
      "statusCode": 301,
      "redirectURL": "/my_er_cloudlet.html",
      "useIncomingQueryString": false,
      "useIncomingSchemeAndHost": true
    }
  ]
 EOF
}

Arguments

Pass a name for your policy, the code representing the type of cloudlet you're using, your group ID, and any optional arguments to create a policy.

ArgumentRequiredDescription
nameA user created name for a policy.
cloudlet_codeThe character code for your cloudlet type.
  • ALB. Application load balancer.
  • AP. API prioritization.
  • AS. Audience segmentation.
  • CD. Phased release.
  • ER. Edge redirector.
  • FR. Forward rewrite
  • IG. Request control.
  • VP. Visitor prioritization.
group_idYour group ID.
is_sharedThe type of policy to create.
  • true. Shared policy. When used, you can associate multiple properties on a single activation.
  • false. Non-shared or traditional policy. When used, the property association is to a single property per activation.
descriptionA human-readable description about your policy version.
match_rule_formatYour match_rules version.
match_rulesThe rules for your policy in JSON format, in the resource or a pointer to the file.
timeoutsUses a default argument to override the HashiCorp processing timeout of 20 minutes. Value is a string containing a number and its time reference, h, m, s. You can pass one, two, or all values. For example:
  • 1h3m5s
  • 2h5m
  • 3m

Attributes

Returned to you are your cloudlet's ID and version along with a jsonencoded list of warnings.