Skip to content

azurermStreamAnalyticsOutputSynapse

Manages a Stream Analytics Output to an Azure Synapse Analytics 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: "rg-example",
  }
);
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",
      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 dataAzurermStreamAnalyticsJobExample =
  new azurerm.dataAzurermStreamAnalyticsJob.DataAzurermStreamAnalyticsJob(
    this,
    "example_4",
    {
      name: "example-job",
      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.*/
dataAzurermStreamAnalyticsJobExample.overrideLogicalId("example");
const azurermStreamAnalyticsOutputSynapseExample =
  new azurerm.streamAnalyticsOutputSynapse.StreamAnalyticsOutputSynapse(
    this,
    "example_5",
    {
      database: "master",
      name: "example-output-synapse",
      password: azurermSynapseWorkspaceExample.sqlAdministratorLoginPassword,
      resource_group_name:
        dataAzurermStreamAnalyticsJobExample.resourceGroupName,
      server: `\${${azurermSynapseWorkspaceExample.connectivityEndpoints.fqn}["sqlOnDemand"]}`,
      stream_analytics_job_name: dataAzurermStreamAnalyticsJobExample.name,
      table: "ExampleTable",
      user: azurermSynapseWorkspaceExample.sqlAdministratorLogin,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStreamAnalyticsOutputSynapseExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Stream Output. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.

  • streamAnalyticsJobName - (Required) The name of the Stream Analytics Job. Changing this forces a new resource to be created.

  • server - (Required) The name of the SQL server containing the Azure SQL database. Changing this forces a new resource to be created.

  • database - (Required) The name of the Azure SQL database. Changing this forces a new resource to be created.

  • user - (Required) The user name that will be used to connect to the Azure SQL database. Changing this forces a new resource to be created.

  • password - (Required) The password that will be used to connect to the Azure SQL database.

  • table - (Required) The name of the table in the Azure SQL database. Changing this forces a new resource to be created.

Attributes Reference

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

  • id - The ID of the Stream Analytics Output to an Azure Synapse Analytics Workspace.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Stream Analytics Output to an Azure Synapse Analytics Workspace.
  • update - (Defaults to 30 minutes) Used when updating the Stream Analytics Output to an Azure Synapse Analytics Workspace.
  • read - (Defaults to 5 minutes) Used when retrieving the Stream Analytics Output to an Azure Synapse Analytics Workspace.
  • delete - (Defaults to 30 minutes) Used when deleting the Stream Analytics Output to an Azure Synapse Analytics Workspace.

Import

A Stream Analytics Output to an Azure Synapse Analytics Workspace can be imported using the resourceId, e.g.

terraform import azurerm_stream_analytics_output_synapse.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1