azurerm_stream_analytics_function_javascript_uda

Manages a JavaScript UDA Function within a Stream Analytics Streaming Job.

Example Usage

data "azurerm_resource_group" "example" {
  name = "example-resources"
}

data "azurerm_stream_analytics_job" "example" {
  name                = "example-job"
  resource_group_name = data.azurerm_resource_group.example.name
}

resource "azurerm_stream_analytics_function_javascript_uda" "example" {
  name                    = "example-javascript-function"
  stream_analytics_job_id = data.azurerm_stream_analytics_job.example.id

  script = <<SCRIPT
function main() {
    this.init = function () {
        this.state = 0;
    }

    this.accumulate = function (value, timestamp) {
        this.state += value;
    }

    this.computeResult = function () {
        return this.state;
    }
}
SCRIPT

  input {
    type = "bigint"
  }

  output {
    type = "bigint"
  }
}

Argument Reference

The following arguments are supported:


An input block supports the following:


An output block supports the following:

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 JavaScript UDA Functions can be imported using the resource id, e.g.

terraform import azurerm_stream_analytics_function_javascript_uda.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/functions/func1