Skip to content

azurermMediaServicesAccount

Manages a Media Services Account.

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

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Media Services Account. Only lowercase Alphanumeric characters allowed. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the Media Services Account. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • storageAccount - (Required) One or more storageAccount blocks as defined below.

  • encryption - (Optional) An encryption block as defined below.

  • identity - (Optional) An identity block as defined below.

  • publicNetworkAccessEnabled - (Optional) Whether public network access is allowed for this server. Defaults to true.

  • storageAuthenticationType - (Optional) Specifies the storage authentication type. Possible value is managedIdentity or system.

  • keyDeliveryAccessControl - (Optional) A keyDeliveryAccessControl block as defined below.

  • tags - (Optional) A mapping of tags assigned to the resource.


A storageAccount block supports the following:

  • id - (Required) Specifies the ID of the Storage Account that will be associated with the Media Services instance.

  • isPrimary - (Optional) Specifies whether the storage account should be the primary account or not. Defaults to false.

\~> NOTE: Whilst multiple storageAccount blocks can be specified - one of them must be set to the primary

  • managedIdentity - (Optional) A managedIdentity block as defined below.

A encryption block supports the following:

  • type - (Optional) Specifies the type of key used to encrypt the account data. Possible values are systemKey and customerKey.

  • keyVaultKeyIdentifier - (Optional) Specifies the URI of the Key Vault Key used to encrypt data. The key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key without a version (for example https://vault/keys/mykey).

  • managedIdentity - (Optional) A managedIdentity block as defined below.


A identity block supports the following:

  • type - (Required) Specifies the type of Managed Service Identity that should be configured on this Media Services Account. Possible values are systemAssigned, userAssigned, systemAssigned,UserAssigned (to enable both).

  • identityIds - (Optional) Specifies a list of User Assigned Managed Identity IDs to be assigned to this Media Services Account.


A keyDeliveryAccessControl block supports the following:

  • defaultAction - (Optional) The Default Action to use when no rules match from ipAllowList. Possible values are allow and deny.

  • ipAllowList - (Optional) One or more IP Addresses, or CIDR Blocks which should be able to access the Key Delivery.


A managedIdentity block supports the following:

  • userAssignedIdentityId - (Optional) The ID of the User Assigned Identity. This value can only be set when useSystemAssignedIdentity is false

  • useSystemAssignedIdentity - (Optional) Whether to use System Assigned Identity. Possible Values are true and false.


Attributes Reference

The following attributes are exported:

  • id - The ID of the Media Services Account.

  • identity - An identity block as defined below.


An encryption block exports the following:

  • currentKeyIdentifier - The current key used to encrypt the Media Services Account, including the key version.

An identity block exports the following:

  • principalId - The Principal ID associated with this Managed Service Identity.

  • tenantId - The Tenant ID associated with this Managed Service Identity.

Timeouts

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

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

Import

Media Services Accounts can be imported using the resourceId, e.g.

terraform import azurerm_media_services_account.account /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Media/mediaServices/account1