Skip to content

azurermMediaStreamingLocator

Manages a Media Streaming Locator.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "media-resources",
  }
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_1",
  {
    account_replication_type: "GRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "examplestoracc",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageAccountExample.overrideLogicalId("example");
const azurermMediaServicesAccountExample =
  new azurerm.mediaServicesAccount.MediaServicesAccount(this, "example_2", {
    location: azurermResourceGroupExample.location,
    name: "examplemediaacc",
    resource_group_name: azurermResourceGroupExample.name,
    storage_account: [
      {
        id: azurermStorageAccountExample.id,
        is_primary: true,
      },
    ],
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMediaServicesAccountExample.overrideLogicalId("example");
const azurermMediaServicesAccountFilterExample =
  new azurerm.mediaServicesAccountFilter.MediaServicesAccountFilter(
    this,
    "example_3",
    {
      media_services_account_name: azurermMediaServicesAccountExample.name,
      name: "Filter1",
      resource_group_name: azurermResourceGroupExample.name,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMediaServicesAccountFilterExample.overrideLogicalId("example");
const azurermMediaAssetExample = new azurerm.mediaAsset.MediaAsset(
  this,
  "example_4",
  {
    description: "Asset description",
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "Asset1",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMediaAssetExample.overrideLogicalId("example");
const azurermMediaStreamingLocatorExample =
  new azurerm.mediaStreamingLocator.MediaStreamingLocator(this, "example_5", {
    asset_name: azurermMediaAssetExample.name,
    filter_names: [azurermMediaServicesAccountFilterExample.name],
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "example",
    resource_group_name: azurermResourceGroupExample.name,
    streaming_policy_name: "Predefined_ClearStreamingOnly",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMediaStreamingLocatorExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • assetName - (Required) Asset Name. Changing this forces a new Streaming Locator to be created.

  • mediaServicesAccountName - (Required) The Media Services account name. Changing this forces a new Streaming Locator to be created.

  • name - (Required) The name which should be used for this Streaming Locator. Changing this forces a new Streaming Locator to be created.

  • resourceGroupName - (Required) The name of the Resource Group where the Streaming Locator should exist. Changing this forces a new Streaming Locator to be created.

  • streamingPolicyName - (Required) Name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: predefinedDownloadOnly, predefinedClearStreamingOnly, predefinedDownloadAndClearStreaming, predefinedClearKey, predefinedMultiDrmCencStreaming and predefinedMultiDrmStreaming. Changing this forces a new Streaming Locator to be created.


  • alternativeMediaId - (Optional) Alternative Media ID of this Streaming Locator. Changing this forces a new Streaming Locator to be created.

  • contentKey - (Optional) One or more contentKey blocks as defined below. Changing this forces a new Streaming Locator to be created.

  • defaultContentKeyPolicyName - (Optional) Name of the default Content Key Policy used by this Streaming Locator.Changing this forces a new Streaming Locator to be created.

  • endTime - (Optional) The end time of the Streaming Locator. Changing this forces a new Streaming Locator to be created.

  • filterNames - (Optional) A list of names of asset or account filters which apply to this Streaming Locator. Changing this forces a new Streaming Locator to be created.

  • startTime - (Optional) The start time of the Streaming Locator. Changing this forces a new Streaming Locator to be created.

  • streamingLocatorId - (Optional) The ID of the Streaming Locator. Changing this forces a new Streaming Locator to be created.


A contentKey block supports the following:

  • contentKeyId - (Optional) ID of Content Key. Changing this forces a new Streaming Locator to be created.

  • labelReferenceInStreamingPolicy - (Optional) Label of Content Key as specified in the Streaming Policy. Changing this forces a new Streaming Locator to be created.

  • policyName - (Optional) Content Key Policy used by Content Key. Changing this forces a new Streaming Locator to be created.

  • type - (Optional) Encryption type of Content Key. Supported values are commonEncryptionCbcs, commonEncryptionCenc or envelopeEncryption. Changing this forces a new Streaming Locator to be created.

  • value - (Optional) Value of Content Key. Changing this forces a new Streaming Locator to be created.

Attributes Reference

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

  • id - The ID of the Streaming Locator.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Streaming Locator.
  • read - (Defaults to 5 minutes) Used when retrieving the Streaming Locator.
  • delete - (Defaults to 30 minutes) Used when deleting the Streaming Locator.

Import

Streaming Locators can be imported using the resourceId, e.g.

terraform import azurerm_media_streaming_locator.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/account1/streamingLocators/locator1