使用Terraform配置Azure媒体服务:特别是Widervine DRM的内容密钥策略



我正在尝试使用Terraform来配置Azure Media Services,并且可以使主要批量工作,例如资源组、存储帐户等,但找不到任何文档或创建内容密钥策略的示例,使用DRM(Widervine(&JWT令牌,我还需要添加此json用于许可证设置:

{
"allowed_track_types": "SD_HD",
"content_key_specs": [
{
"track_type": "SD",
"security_level": 1,
"required_output_protection": {
"hdcp": "HDCP_NONE",
"cgms_flags": null
}
}
],
"policy_overrides": {
"can_play": true,
"can_persist": true,
"can_renew": false,
"rental_duration_seconds": 2592000,
"playback_duration_seconds": 10800,
"license_duration_seconds": 604800
}
}

当前main.tf文件:

terraform {
required_providers {
azurerm = {
source  = "hashicorp/azurerm"
version = ">= 2.26"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name     = join("", [ var.prefix, "mediaservices" ])
location = var.location
}
resource "azurerm_storage_account" "sa" {
name                     = join("", [ var.prefix, "storageaccount" ])
resource_group_name      = azurerm_resource_group.rg.name
location                 = azurerm_resource_group.rg.location
account_tier             = "Standard"
account_replication_type = "LRS"
tags = {
environment = "staging"
}
}
resource "azurerm_storage_container" "sc1" {
name                  = "archive"
storage_account_name  = azurerm_storage_account.sa.name
container_access_type = "private"
}
resource "azurerm_storage_container" "sc2" {
name                  = "tobeprocessed"
storage_account_name  = azurerm_storage_account.sa.name
container_access_type = "private"
}
resource "azurerm_media_services_account" "ams" {
name                = join("", [ var.prefix, "mediaservices" ])
location            = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
storage_account {
id         = azurerm_storage_account.sa.id
is_primary = true
}
}
output "resourceGroupName" {
value = azurerm_resource_group.rg.name
}
output "containerConnectionString" {
value = azurerm_storage_account.sa.primary_connection_string
}
data "azurerm_subscriptions" "available" {
}
output "subscriptionId" {
value = data.azurerm_subscriptions.available.subscriptions[ 0 ].subscription_id
}

您可以在此处找到Widevine许可证的文档:Media Services v3 with Widevine license template overview以及其他内容保护信息。

最新更新