Skip to content

azurermMediaAsset

Manages a Media Asset.

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",
  {
    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");

Arguments Reference

The following arguments are supported:

  • mediaServicesAccountName - (Required) Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.

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

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


  • alternateId - (Optional) The alternate ID of the Asset.

  • container - (Optional) The name of the asset blob container. Changing this forces a new Media Asset to be created.

  • description - (Optional) The Asset description.

  • storageAccountName - (Optional) The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.

Attributes Reference

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

  • id - The ID of the Media Asset.

Timeouts

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

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

Import

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

terraform import azurerm_media_asset.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/account1/assets/asset1