Skip to content

azurermMachineLearningDatastoreDatalakeGen2

Manages a Machine Learning Data Lake Gen2 DataStore.

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.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_2",
  {
    account_replication_type: "GRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "workspacestorageaccount",
    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 azurermStorageContainerExample =
  new azurerm.storageContainer.StorageContainer(this, "example_3", {
    container_access_type: "private",
    name: "example-container",
    storage_account_name: azurermStorageAccountExample.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.*/
azurermStorageContainerExample.overrideLogicalId("example");
const dataAzurermClientConfigCurrent =
  new azurerm.dataAzurermClientConfig.DataAzurermClientConfig(
    this,
    "current",
    {}
  );
const azurermApplicationInsightsExample =
  new azurerm.applicationInsights.ApplicationInsights(this, "example_5", {
    application_type: "web",
    location: azurermResourceGroupExample.location,
    name: "workspace-example-ai",
    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.*/
azurermApplicationInsightsExample.overrideLogicalId("example");
const azurermKeyVaultExample = new azurerm.keyVault.KeyVault(
  this,
  "example_6",
  {
    location: azurermResourceGroupExample.location,
    name: "workspaceexamplekeyvault",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "premium",
    tenant_id: dataAzurermClientConfigCurrent.tenantId,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKeyVaultExample.overrideLogicalId("example");
const azurermMachineLearningWorkspaceExample =
  new azurerm.machineLearningWorkspace.MachineLearningWorkspace(
    this,
    "example_7",
    {
      application_insights_id: azurermApplicationInsightsExample.id,
      identity: [
        {
          type: "SystemAssigned",
        },
      ],
      key_vault_id: azurermKeyVaultExample.id,
      location: azurermResourceGroupExample.location,
      name: "example-workspace",
      resource_group_name: azurermResourceGroupExample.name,
      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.*/
azurermMachineLearningWorkspaceExample.overrideLogicalId("example");
const azurermMachineLearningDatastoreDatalakeGen2Example =
  new azurerm.machineLearningDatastoreDatalakeGen2.MachineLearningDatastoreDatalakeGen2(
    this,
    "example_8",
    {
      name: "example-datastore",
      storage_container_id: azurermStorageContainerExample.resourceManagerId,
      workspace_id: azurermMachineLearningWorkspaceExample.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.*/
azurermMachineLearningDatastoreDatalakeGen2Example.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name of the Machine Learning DataStore. Changing this forces a new Machine Learning DataStore to be created.

  • workspaceId - (Required) The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning DataStore to be created.

  • storageContainerId - (Required) The ID of the Storage Account Container. Changing this forces a new Machine Learning DataStore to be created.


  • tenantId - (Optional) The ID of the Tenant which the Service Principal belongs to.

  • clientId - (Optional) The object ID of the Service Principal.

  • clientSecret - (Optional) The secret of the Service Principal.

  • authorityUrl - (Optional) An URL used for authentication.

  • description - (Optional) Text used to describe the asset. Changing this forces a new Machine Learning DataStore to be created.

  • serviceDataIdentity - (Optional) Specifies which identity to use when retrieving data from the specified source. Defaults to none. Possible values are none, workspaceSystemAssignedIdentity and workspaceUserAssignedIdentity.

  • tags - (Optional) A mapping of tags which should be assigned to the Machine Learning DataStore. Changing this forces a new Machine Learning DataStore to be created.

Attributes Reference

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

  • id - The ID of the Machine Learning DataStore.

  • isDefault - Indicates whether this Machines Learning DataStore is the default for the Workspace.

Timeouts

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

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

Import

Machine Learning DataStores can be imported using the resourceId, e.g.

terraform import azurerm_machine_learning_datastore_datalake_gen2.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.MachineLearningServices/workspaces/mlw1/datastores/datastore1