Skip to content

azurermStorageDataLakeGen2Filesystem

Manages a Data Lake Gen2 File System within an Azure Storage Account.

\~> NOTE: This resource requires some storage specific roles which are not granted by default. Some of the built-ins roles that can be attributed are storageAccountContributor, storageBlobDataOwner, storageBlobDataContributor, storageBlobDataReader.

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: "example-resources",
  }
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_1",
  {
    account_kind: "StorageV2",
    account_replication_type: "LRS",
    account_tier: "Standard",
    is_hns_enabled: "true",
    location: azurermResourceGroupExample.location,
    name: "examplestorageacc",
    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 azurermStorageDataLakeGen2FilesystemExample =
  new azurerm.storageDataLakeGen2Filesystem.StorageDataLakeGen2Filesystem(
    this,
    "example_2",
    {
      name: "example",
      properties: [
        {
          hello: "aGVsbG8=",
        },
      ],
      storage_account_id: azurermStorageAccountExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageDataLakeGen2FilesystemExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Data Lake Gen2 File System which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.

  • storageAccountId - (Required) Specifies the ID of the Storage Account in which the Data Lake Gen2 File System should exist. Changing this forces a new resource to be created.

  • properties - (Optional) A mapping of Key to Base64-Encoded Values which should be assigned to this Data Lake Gen2 File System.

  • ace - (Optional) One or more ace blocks as defined below to specify the entries for the ACL for the path.

  • owner - (Optional) Specifies the Object ID of the Azure Active Directory User to make the owning user of the root path (i.e. /). Possible values also include $superuser.

  • group - (Optional) Specifies the Object ID of the Azure Active Directory Group to make the owning group of the root path (i.e. /). Possible values also include $superuser.

\~> NOTE: The Storage Account requires accountKind to be either storageV2 or blobStorage. In addition, isHnsEnabled has to be set to true.


An ace block supports the following:

  • scope - (Optional) Specifies whether the ACE represents an access entry or a default entry. Default value is access.

  • type - (Required) Specifies the type of entry. Can be user, group, mask or other.

  • id - (Optional) Specifies the Object ID of the Azure Active Directory User or Group that the entry relates to. Only valid for user or group entries.

  • permissions - (Required) Specifies the permissions for the entry in rwx form. For example, rwx gives full permissions but r only gives read permissions.

More details on ACLs can be found here: https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-access-control#access-control-lists-on-files-and-directories

Attributes Reference

The following attributes are exported in addition to the arguments listed above:

  • id - The ID of the Data Lake Gen2 File System.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Data Lake Gen2 File System.
  • update - (Defaults to 30 minutes) Used when updating the Data Lake Gen2 File System.
  • read - (Defaults to 5 minutes) Used when retrieving the Data Lake Gen2 File System.
  • delete - (Defaults to 30 minutes) Used when deleting the Data Lake Gen2 File System.

Import

Data Lake Gen2 File System's can be imported using the resourceId, e.g.

terraform import azurerm_storage_data_lake_gen2_filesystem.queue1 https://account1.dfs.core.windows.net/fileSystem1