Skip to content

azurermSynapseSqlPoolWorkloadClassifier

Manages a Synapse SQL Pool Workload Classifier.

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_kind: "BlobStorage",
    account_replication_type: "LRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "example",
    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_3",
    {
      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_4", {
    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 azurermSynapseSqlPoolExample = new azurerm.synapseSqlPool.SynapseSqlPool(
  this,
  "example_5",
  {
    create_mode: "Default",
    name: "example",
    sku_name: "DW100c",
    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.*/
azurermSynapseSqlPoolExample.overrideLogicalId("example");
const azurermSynapseSqlPoolWorkloadGroupExample =
  new azurerm.synapseSqlPoolWorkloadGroup.SynapseSqlPoolWorkloadGroup(
    this,
    "example_6",
    {
      importance: "normal",
      max_resource_percent: 100,
      max_resource_percent_per_request: 3,
      min_resource_percent: 0,
      min_resource_percent_per_request: 3,
      name: "example",
      query_execution_timeout_in_seconds: 0,
      sql_pool_id: azurermSynapseSqlPoolExample.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.*/
azurermSynapseSqlPoolWorkloadGroupExample.overrideLogicalId("example");
const azurermSynapseSqlPoolWorkloadClassifierExample =
  new azurerm.synapseSqlPoolWorkloadClassifier.SynapseSqlPoolWorkloadClassifier(
    this,
    "example_7",
    {
      context: "example_context",
      end_time: "14:00",
      importance: "high",
      label: "example_label",
      member_name: "dbo",
      name: "example",
      start_time: "12:00",
      workload_group_id: azurermSynapseSqlPoolWorkloadGroupExample.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.*/
azurermSynapseSqlPoolWorkloadClassifierExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Synapse SQL Pool Workload Classifier. Changing this forces a new Synapse SQL Pool Workload Classifier to be created.

  • workloadGroupId - (Required) The ID of the Synapse SQL Pool Workload Group. Changing this forces a new Synapse SQL Pool Workload Classifier to be created.

  • memberName - (Required) The workload classifier member name used to classified against.


  • context - (Optional) Specifies the session context value that a request can be classified against.

  • endTime - (Optional) The workload classifier end time for classification. It's of the hh:mm format in UTC time zone.

  • importance - (Optional) The workload classifier importance. The allowed values are low, belowNormal, normal, aboveNormal and high.

  • label - (Optional) Specifies the label value that a request can be classified against.

  • startTime - (Optional) The workload classifier start time for classification. It's of the hh:mm format in UTC time zone.

Attributes Reference

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

  • id - The ID of the Synapse SQL Pool Workload Classifier.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Synapse SQL Pool Workload Classifier.
  • read - (Defaults to 5 minutes) Used when retrieving the Synapse SQL Pool Workload Classifier.
  • update - (Defaults to 30 minutes) Used when updating the Synapse SQL Pool Workload Classifier.
  • delete - (Defaults to 30 minutes) Used when deleting the Synapse SQL Pool Workload Classifier.

Import

Synapse SQL Pool Workload Classifiers can be imported using the resourceId, e.g.

terraform import azurerm_synapse_sql_pool_workload_classifier.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Synapse/workspaces/workspace1/sqlPools/sqlPool1/workloadGroups/workloadGroup1/workloadClassifiers/workloadClassifier1