Policy video
akamai_imaging_policy_video
Specify details for a video policy, like variations in image size and formats. Then reference this data source in the corresponding resource.
To define variables in your policy, see Use variables.
data "akamai_imaging_policy_video" "my-video-policy-definition" {
policy {
rollout_duration = 3602
breakpoints {
widths = [
320,
640,
1024,
2048,
5000
]
}
output {
placeholder_video_url = "https://example-video.net/specs/im_videos/A7123_BC456_v.mp4"
video_adaptive_quality = "medium"
perceptual_quality_var = "videoQuality"
}
hosts = [
"www.example-1.com",
"www.example-2.com"
]
variables {
name = "videoQuality"
type = "perceptualQuality"
default_value = "mediumHigh"
}
}
}
output "my-video-policy" {
value = data.akamai_imaging_policy_video.my-video-policy-definition
}
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
}
Changes to Outputs:
+ my-video-policy = {
+ id = "12abcd34ef5ghi6i78klmn9012op34qrstuv56wx7yz"
+ json = jsonencode(
{
+ breakpoints = {
+ widths = [
+ 320,
+ 640,
+ 1024,
+ 2048,
+ 5000,
]
}
+ hosts = [
+ "www.example-1.com",
+ "www.example-2.com",
]
+ output = {
+ perceptualQuality = {
+ var = "videoQuality"
}
+ placeholderVideoUrl = "https://example-video.net/specs/im_videos/A7123_BC456_v.mp4"
+ videoAdaptiveQuality = "medium"
}
+ rolloutDuration = 3602
+ variables = [
+ {
+ defaultValue = "mediumHigh"
+ name = "videoQuality"
+ type = "perceptualQuality"
},
]
}
)
+ policy = [
+ {
+ breakpoints = [
+ {
+ widths = [
+ 320,
+ 640,
+ 1024,
+ 2048,
+ 5000,
]
},
]
+ hosts = [
+ "www.example-1.com",
+ "www.example-2.com",
]
+ output = [
+ {
+ perceptual_quality = ""
+ perceptual_quality_var = "videoQuality"
+ placeholder_video_url = "https://example-video.net/specs/im_videos/A7123_BC456_v.mp4"
+ placeholder_video_url_var = ""
+ video_adaptive_quality = "medium"
+ video_adaptive_quality_var = ""
},
]
+ rollout_duration = "3602"
+ variables = [
+ {
+ default_value = "mediumHigh"
+ enum_options = []
+ name = "videoQuality"
+ postfix = ""
+ prefix = ""
+ type = "perceptualQuality"
},
]
},
]
}
Arguments
Pass the required policy
argument in the body of the declaration to specify settings in it for a video policy.
Argument | Required | Description |
---|---|---|
breakpoints |
The list of breakpoint widths in pixels used to create derivative videos. |
|
hosts |
The hosts allowed for video URLs within variables. | |
output |
The output quality of each resized video. Includes:
|
|
rollout_duration |
The amount of time in seconds that it takes for the policy to roll out. It can be between 3600 –604800 seconds. During the rollout, the proportion of videos with the new policy applied continually increases until cached videos associated with the previous version of the policy are no longer being served. |
|
variables |
The variables available for the policy. You can reference any variable declared here in output . You can also pass in these variable names and values dynamically as query parameters in the video's request URL. See Use variables for more information. Includes:
|
Attributes
Returned to you is the JSON-encoded video policy.
Updated 1 day ago