azurerm_media_content_key_policy

Manages a Content Key Policy.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "media-resources"
  location = "West Europe"
}

resource "azurerm_storage_account" "example" {
  name                     = "examplestoracc"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "GRS"
}

resource "azurerm_media_services_account" "example" {
  name                = "examplemediaacc"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  storage_account {
    id         = azurerm_storage_account.example.id
    is_primary = true
  }
}

resource "azurerm_media_content_key_policy" "example" {
  name                        = "example"
  resource_group_name         = azurerm_resource_group.example.name
  media_services_account_name = azurerm_media_services_account.example.name
  policy_option {
    name = "fairPlay"
    fairplay_configuration {
      ask                       = "bb566284cc124a21c435a92cd3c108c4"
      pfx                       = "MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdr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VStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A="
      pfx_password              = "password"
      rental_duration_seconds   = 2249
      rental_and_lease_key_type = "PersistentUnlimited"

    }
    open_restriction_enabled = true
  }
  policy_option {
    name = "playReady"
    playready_configuration_license {
      allow_test_devices = true
      begin_date         = "2017-10-16T18:22:53Z"
      security_level     = "SL150"
      play_right {
        scms_restriction                                         = 2
        digital_video_only_content_restriction                   = false
        image_constraint_for_analog_component_video_restriction  = false
        image_constraint_for_analog_computer_monitor_restriction = false
        allow_passing_video_content_to_unknown_output            = "NotAllowed"
        uncompressed_digital_video_opl                           = 100
        uncompressed_digital_audio_opl                           = 100
        analog_video_opl                                         = 150
        compressed_digital_audio_opl                             = 250
        compressed_digital_video_opl                             = 400
        explicit_analog_television_output_restriction {
          best_effort_enforced = true
          control_bits         = 3
        }
      }
      license_type                             = "Persistent"
      content_type                             = "UltraVioletDownload"
      content_key_location_from_header_enabled = true
    }
    open_restriction_enabled = true
  }
  policy_option {
    name                            = "clearKey"
    clear_key_configuration_enabled = true
    token_restriction {
      issuer                      = "urn:issuer"
      audience                    = "urn:audience"
      token_type                  = "Swt"
      primary_symmetric_token_key = "AAAAAAAAAAAAAAAAAAAAAA=="
      alternate_key {
        rsa_token_key_exponent = "AQAB"
        rsa_token_key_modulus  = "AQAD"
      }
      alternate_key {
        symmetric_token_key = "BBAAAAAAAAAAAAAAAAAAAA=="
      }
    }
  }
  policy_option {
    name = "widevine"
    widevine_configuration_template = jsonencode({
      "allowed_track_types" : "SD_HD",
      "content_key_specs" : [{
        "track_type" : "SD",
        "security_level" : 1,
        "required_output_protection" : {
          "hdcp" : "HDCP_V2"
        },
      }],
      "policy_overrides" : {
        "can_play" : true,
        "can_persist" : true,
        "can_renew" : false,
      },
    })
    open_restriction_enabled = true
  }
}

Arguments Reference

The following arguments are supported:



A alternate_key block supports the following:


An explicit_analog_television_output_restriction block supports the following:


A fairplay_configuration block supports the following:


A offline_rental_configuration block supports the following:


A play_right block supports the following:


A playready_configuration_license block supports the following:


A policy_option block supports the following:


A required_claim block supports the following:


A token_restriction block supports the following:


Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Content Key Policy can be imported using the resource id, e.g.

terraform import azurerm_media_content_key_policy.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/account1/contentKeyPolicies/policy1