GuideReference
TrainingSupportCommunity
Guide

Set up Cloudlets policies

Cloudlets are our applications at the edge of the content delivery platform. Each Cloudlet helps to solve specific challenges and bring your site's business logic closer to your end user.

Before you begin

Create Cloudlet policies

A policy is a versioned container for the rules that govern how a Cloudlet behaves. You can create a new policy or use an existing one.

📘

The Cloudlets subprovider does not support shared policies. To use them, see the Cloudlets API or the Akamai PowerShell module.

Create new

To create a new policy, use your Cloudlet type as a code in the akamai_cloudlets_policy resource.

resource "akamai_cloudlets_policy" "my-new-cloudlet-policy" {
  name          = "policy1"
  cloudlet_code = "ER"
  group_id      = "12345"

New policies are empty and the system automatically sets the version number at one.

Get existing

Use the name of the policy you want as the value for the export-cloudlets-policy argument of the akamai CLI command.

akamai terraform --edgerc {location-of-your-edgerc-file} --section {section-of-edgerc-to-use} export-cloudlets-policy {"policy-name"}

Run the included import script to populate your Terraform state. This prevents Terraform from attempting to recreate your assets.

Add rules to policies

For each policy you have, you can specify up to 5000 rules. Cloudlet rules contain general settings specific to the Cloudlet you're using, an if statement that sets the match criteria, and a then statement for the action to take. Add them directly with resource attributes or reference a JSON-encoded output of the match rule data source.

Order your rules so that the ones that will exclude the most incoming requests are towards the top of the list. If an incoming request doesn't trigger a rule, then the Cloudlet doesn't execute, and the request is then evaluated against your property rules.

🚧

Cloudlets don't support child rules or else statements.

Activate Cloudlet policies

Once you're satisfied with a policy version, use the akamai_cloudlets_policy_activation resource to associate your Cloudlet's policy version with one or more properties in a compatible group.

Run terraform apply to deploy your policy to either the staging or production network.

📘

Once you activate a policy version on either of the networks, any change to the akamai_cloudlets_policy resource creates and activates a new version upon running terraform apply.

Assign Cloudlet to property

To implement an activated Cloudlet on the edge, you need to add your Cloudlet's behavior to the JSON rule tree file in each property associated with your policy. See [Property Provisioning](doc: et-up-property-provisioning) for detailed instructions.

To customize the settings, see the behavior for your Cloudlet in the Property Manager API (PAPI) documentation:

CloudletBehavior
API Prioritizationapi_prioritization
Application Load Balancerapplication_load_balancer
Audience Segmentationaudience_segmentation
Edge Redirectoredge_redirector
Forward Rewriteforward_rewrite
Phased Releasephased_release
Request Controlrequest_control
Visitor Prioritizationvisitor_prioritization

Activate property

Use the akamai_property_activation resource to activate the modified property version on the production network. An active Cloudlet policy won't be applied to the user requests unless you activate the property version with appropriate Cloudlet behavior enabled.

Run terraform apply again to implement the changes.

Additional information

For information on each of our Cloudlets, see Available Cloudlets.