Policy video

akamai_imaging_policy_video

Create, update, or delete a video policy within your policy set. Use terraform destroy to remove it.

To define variables in your policy, see Use variables.

resource "akamai_imaging_policy_video" "my-video-policy" {
  activate_on_production = false
  contract_id            = "12345"
  policy_id              = "my-video-policy-1"
  policyset_id           = akamai_imaging_policy_set.my-policy-set.id
  json = jsonencode(
    {
      "breakpoints" : {
        "widths" : [
          320,
          640,
          1024,
          2048,
          5000
        ]
      },
      "output" : {
        "perceptualQuality" : {
          "var" : "videoQuality"
        },
        "videoAdaptiveQuality" : {
          "var" : "videoQuality"
        }
      },
      "hosts" : [
        "www.example-1.com",
        "www.example-2.com"
      ],
      "rolloutDuration" : 3600,
      "variables" : [
        {
          "type" : "perceptualQuality",
          "defaultValue" : "mediumHigh",
          "name" : "videoQuality"
        }
      ],
    }
  )
}
// Use a path to a JSON-formatted policy
resource "akamai_imaging_policy_video" "my-video-policy" {
  activate_on_production = false
  contract_id            = "12345"
  policy_id              = "my-video-policy-1"
  policyset_id           = akamai_imaging_policy_set.my-policy-set.id
  json                   = file("${path.module}/video_policy.json")
}

// Reference a video policy data source
resource "akamai_imaging_policy_image" "my-video-policy" {
  activate_on_production = false
  contract_id            = "12345"
  policy_id              = "my-video-policy-1"
  policyset_id           = akamai_imaging_policy_set.my-policy-set.id
  json                   = data.akamai_imaging_policy_video.my-video-policy-definition.json
}

Arguments

Send all the required arguments to create a video policy.

ArgumentRequiredDescription
contract_idYour contract's ID.
policy_idYour video policy's ID. If you change this value, Terraform forces a replacement. It destroys your current policy and creates a new one.
policyset_idYour video policy set's ID.
jsonYour JSON-encoded video policy.
activate_on_productionWhen set to true, the policy is saved on the production network. You can set it back to false only when there are any changes to the existing policy qualifying it for a new version. Setting it to false allows you to make changes on staging without affecting the version already saved to production. Defaults to false if not set.

Attributes

There is no default standard output. Upon creation, the last line of the process log contains a success message with the resources's id in the policyset_id:policy_id format.

Adding an output block returns the video policy details you provided on create and the computed id and version attributes.