Skip to content

azurermMediaJob

Manages a Media Job.

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 azurermMediaTransformExample = new azurerm.mediaTransform.MediaTransform(
  this,
  "example_3",
  {
    description: "My transform description",
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "transform1",
    output: [
      {
        builtin_preset: [
          {
            preset_name: "AACGoodQualityAudio",
          },
        ],
        on_error_action: "ContinueJob",
        relative_priority: "Normal",
      },
    ],
    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.*/
azurermMediaTransformExample.overrideLogicalId("example");
const azurermMediaAssetInput = new azurerm.mediaAsset.MediaAsset(
  this,
  "input",
  {
    description: "Input Asset description",
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "input",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
const azurermMediaAssetOutput = new azurerm.mediaAsset.MediaAsset(
  this,
  "output",
  {
    description: "Output Asset description",
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "output",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
const azurermMediaJobExample = new azurerm.mediaJob.MediaJob(
  this,
  "example_6",
  {
    description: "My Job description",
    input_asset: [
      {
        name: azurermMediaAssetInput.name,
      },
    ],
    media_services_account_name: azurermMediaServicesAccountExample.name,
    name: "job1",
    output_asset: [
      {
        name: azurermMediaAssetOutput.name,
      },
    ],
    priority: "Normal",
    resource_group_name: azurermResourceGroupExample.name,
    transform_name: azurermMediaTransformExample.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.*/
azurermMediaJobExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • inputAsset - (Required) A inputAsset block as defined below. Changing this forces a new Media Job to be created.

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

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

  • outputAsset - (Required) One or more outputAsset blocks as defined below. Changing this forces a new Media Job to be created.

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

  • transformName - (Required) The Transform name. Changing this forces a new Media Job to be created.


  • description - (Optional) Optional customer supplied description of the Job.

  • priority - (Optional) Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Changing this forces a new Media Job to be created. Possible values are high, normal and low.


An inputAsset block supports the following:

  • name - (Required) The name of the input Asset. Changing this forces a new Media Job to be created.

  • label - (Optional) A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. Changing this forces a new resource to be created.


An outputAsset block supports the following:

  • name - (Required) The name of the output Asset. Changing this forces a new Media Job to be created.

  • label - (Optional) A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. Changing this forces a new resource to be created.

Attributes Reference

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

  • id - The ID of the Media Job.

Timeouts

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

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

Import

Media Jobs can be imported using the resourceId, e.g.

terraform import azurerm_media_job.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Media/mediaServices/account1/transforms/transform1/jobs/job1