azurerm_stream_analytics_output_function

Manages a Stream Analytics Output Function.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_storage_account" "example" {
  name                     = "examplestorageaccount"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_app_service_plan" "example" {
  name                = "exampleappserviceplan"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  kind                = "FunctionApp"
  reserved            = true

  sku {
    tier = "Dynamic"
    size = "Y1"
  }
}

resource "azurerm_function_app" "example" {
  name                       = "examplefunctionapp"
  location                   = azurerm_resource_group.example.location
  resource_group_name        = azurerm_resource_group.example.name
  app_service_plan_id        = azurerm_app_service_plan.example.id
  storage_account_name       = azurerm_storage_account.example.name
  storage_account_access_key = azurerm_storage_account.example.primary_access_key
  os_type                    = "linux"
  version                    = "~3"
}

resource "azurerm_stream_analytics_job" "example" {
  name                 = "examplestreamanalyticsjob"
  resource_group_name  = azurerm_resource_group.example.name
  location             = azurerm_resource_group.example.location
  streaming_units      = 3
  transformation_query = <<QUERY
    SELECT *
    INTO [YourOutputAlias]
    FROM [YourInputAlias]
QUERY
}

resource "azurerm_stream_analytics_output_function" "example" {
  name                      = "exampleoutput"
  resource_group_name       = azurerm_stream_analytics_job.example.resource_group_name
  stream_analytics_job_name = azurerm_stream_analytics_job.example.name
  function_app              = azurerm_function_app.example.name
  function_name             = "examplefunctionname"
  api_key                   = "exampleapikey"
}

Arguments Reference

The following arguments are supported:


Attributes Reference

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

Timeouts

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

Import

Stream Analytics Output Functions can be imported using the resource id, e.g.

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