Skip to content

azurermMachineLearningSynapseSpark

Manages the linked service to link an Azure Machine learning workspace to an Azure Synapse workspace.

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-rg",
    tags: {
      stage: "example",
    },
  }
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_1",
  {
    account_replication_type: "LRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "examplesa",
    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",
      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");
const azurermSynapseWorkspaceExample =
  new azurerm.synapseWorkspace.SynapseWorkspace(this, "example_3", {
    identity: [
      {
        type: "SystemAssigned",
      },
    ],
    location: azurermResourceGroupExample.location,
    name: "example",
    resource_group_name: azurermResourceGroupExample.name,
    sql_administrator_login: "sqladminuser",
    sql_administrator_login_password: "H@Sh1CoR3!",
    storage_data_lake_gen2_filesystem_id:
      azurermStorageDataLakeGen2FilesystemExample.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.*/
azurermSynapseWorkspaceExample.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: "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: "example-kv",
    purge_protection_enabled: true,
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "standard",
    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-mlw",
      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 azurermSynapseSparkPoolExample =
  new azurerm.synapseSparkPool.SynapseSparkPool(this, "example_8", {
    name: "example",
    node_count: 3,
    node_size: "Small",
    node_size_family: "MemoryOptimized",
    synapse_workspace_id: azurermSynapseWorkspaceExample.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.*/
azurermSynapseSparkPoolExample.overrideLogicalId("example");
const azurermMachineLearningSynapseSparkExample =
  new azurerm.machineLearningSynapseSpark.MachineLearningSynapseSpark(
    this,
    "example_9",
    {
      identity: [
        {
          type: "SystemAssigned",
        },
      ],
      location: azurermResourceGroupExample.location,
      machine_learning_workspace_id: azurermMachineLearningWorkspaceExample.id,
      name: "example",
      synapse_spark_pool_id: azurermSynapseSparkPoolExample.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.*/
azurermMachineLearningSynapseSparkExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Machine Learning Synapse Spark. Changing this forces a new Machine Learning Synapse Spark to be created.

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

  • location - (Required) The Azure Region where the Machine Learning Synapse Spark should exist. Changing this forces a new Machine Learning Synapse Spark to be created.

  • synapseSparkPoolId - (Required) The ID of the linked Synapse Spark Pool. Changing this forces a new Machine Learning Synapse Spark to be created.


  • description - (Optional) The description of the Machine Learning Synapse Spark. Changing this forces a new Machine Learning Synapse Spark to be created.

  • identity - (Optional) An identity block as defined below. Changing this forces a new Machine Learning Synapse Spark to be created.

  • localAuthEnabled - (Optional) Whether local authentication methods is enabled. Defaults to true. Changing this forces a new Machine Learning Synapse Spark to be created.

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


An identity block supports the following:

  • type - (Required) Specifies the type of Managed Service Identity that should be configured on this Machine Learning Synapse Spark. Possible values are systemAssigned, userAssigned, systemAssigned,UserAssigned (to enable both). Changing this forces a new resource to be created.

  • identityIds - (Optional) Specifies a list of User Assigned Managed Identity IDs to be assigned to this Machine Learning Synapse Spark. Changing this forces a new resource to be created.

\~> NOTE: This is required when type is set to userAssigned or systemAssigned,UserAssigned.

Attributes Reference

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

  • id - The ID of the Machine Learning Synapse Spark.

  • identity - An identity block as defined below, which contains the Managed Service Identity information for this Machine Learning Synapse Spark.


A identity block exports the following:

  • principalId - The Principal ID for the Service Principal associated with the Managed Service Identity of this Machine Learning Synapse Spark.

  • tenantId - The Tenant ID for the Service Principal associated with the Managed Service Identity of this Machine Learning Synapse Spark.

Timeouts

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

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

Import

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

terraform import azurerm_machine_learning_synapse_spark.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.MachineLearningServices/workspaces/workspace1/computes/compute1