Skip to content

azurermMediaLiveEventOutput

Manages a Azure Media Live Event Output.

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 azurermMediaAssetExample = new azurerm.mediaAsset.MediaAsset(
  this,
  "example_3",
  {
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "inputAsset",
    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 azurermMediaLiveEventExample = new azurerm.mediaLiveEvent.MediaLiveEvent(
  this,
  "example_4",
  {
    description: "My Event Description",
    input: [
      {
        ip_access_control_allow: [
          {
            address: "0.0.0.0",
            name: "AllowAll",
            subnet_prefix_length: 0,
          },
        ],
        key_frame_interval_duration: "PT6S",
        streaming_protocol: "RTMP",
      },
    ],
    location: azurermResourceGroupExample.location,
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "exampleevent",
    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.*/
azurermMediaLiveEventExample.overrideLogicalId("example");
const azurermMediaLiveEventOutputExample =
  new azurerm.mediaLiveEventOutput.MediaLiveEventOutput(this, "example_5", {
    archive_window_duration: "PT5M",
    asset_name: azurermMediaAssetExample.name,
    description: "Test live output 1",
    hls_fragments_per_ts_segment: 5,
    live_event_id: azurermMediaLiveEventExample.id,
    manifest_name: "testmanifest",
    name: "exampleoutput",
    output_snap_time_in_seconds: 0,
    rewind_window_duration: "PT5M",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMediaLiveEventOutputExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • archiveWindowDuration - (Required) iso8601 time between 1 minute to 25 hours to indicate the maximum content length that can be archived in the asset for this live output. This also sets the maximum content length for the rewind window. For example, use pt1H30M to indicate 1 hour and 30 minutes of archive window. Changing this forces a new Live Output to be created.

  • assetName - (Required) The asset that the live output will write to. Changing this forces a new Live Output to be created.

  • liveEventId - (Required) The id of the live event. Changing this forces a new Live Output to be created.

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


  • description - (Optional) The description of the live output. Changing this forces a new Live Output to be created.

  • hlsFragmentsPerTsSegment - (Optional) The number of fragments in an HTTP Live Streaming (HLS) TS segment in the output of the live event. This value does not affect the packing ratio for HLS CMAF output. Changing this forces a new Live Output to be created.

  • manifestName - (Optional) The manifest file name. If not provided, the service will generate one automatically. Changing this forces a new Live Output to be created.

  • outputSnapTimeInSeconds - (Optional) The initial timestamp that the live output will start at, any content before this value will not be archived. Changing this forces a new Live Output to be created.

  • rewindWindownDuration - (Optional) iso8601 time between 1 minute to the duration of archiveWindowDuration to control seek-able window length during Live. The service won't use this property once LiveOutput stops. The archived VOD will have full content with original ArchiveWindowLength. For example, use pt1H30M to indicate 1 hour and 30 minutes of rewind window length. Service will use implicit default value 30m only if Live Event enables LL. Changing this forces a new Live Output to be created.

Attributes Reference

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

  • id - The ID of the Live Output.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Live Output.
  • read - (Defaults to 5 minutes) Used when retrieving the Live Output.
  • update - (Defaults to 30 minutes) Used when updating the Live Output.
  • delete - (Defaults to 30 minutes) Used when deleting the Live Output.

Import

Live Outputs can be imported using the resourceId, e.g.

terraform import azurerm_media_live_event_output.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/account1/liveEvents/event1/liveOutputs/output1