» azurerm_stream_analytics_output_mssql

Manages a Stream Analytics Output to Microsoft SQL Server Database.

» Example Usage

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

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

resource "azurerm_sql_server" "example" {
  name                         = "example-server"
  resource_group_name          = "${azurerm_resource_group.example.name}"
  location                     = "${azurerm_resource_group.example.location}"
  version                      = "12.0"
  administrator_login          = "dbadmin"
  administrator_login_password = "example-password"
}

resource "azurerm_sql_database" "example" {
  name                             = "exampledb"
  resource_group_name              = "${azurerm_resource_group.example.name}"
  location                         = "${azurerm_resource_group.example.location}"
  server_name                      = "${azurerm_sql_server.example.name}"
  requested_service_objective_name = "S0"
  collation                        = "SQL_LATIN1_GENERAL_CP1_CI_AS"
  max_size_bytes                   = "268435456000"
  create_mode                      = "Default"
}

resource "azurerm_stream_analytics_output_mssql" "example" {
  name                      = "example-output-sql"
  stream_analytics_job_name = "${azurerm_stream_analytics_job.example.name}"
  resource_group_name       = "${azurerm_stream_analytics_job.example.resource_group_name}"

  server   = "${azurerm_sql_server.example.fully_qualified_domain_name}"
  user     = "${azurerm_sql_server.example.administrator_login}"
  password = "${azurerm_sql_server.example.administrator_login_password}"
  database = "${azurerm_sql_database.example.name}"
  table    = "ExampleTable"
}

» Argument Reference

The following arguments are supported:

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

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

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

  • server - (Required) The SQL server url. Changing this forces a new resource to be created.

  • user - (Required) Username used to login to the Microsoft SQL Server. Changing this forces a new resource to be created.

  • password - (Required) Password used together with username, to login to the Microsoft SQL Server. Changing this forces a new resource to be created.

  • table - (Required) Table in the database that the output points to. 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 Microsoft SQL Server Database.

» Import

Stream Analytics Outputs to Microsoft SQL Server Database can be imported using the resource id, e.g.

terraform import azurerm_stream_analytics_output_mssql.test /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/group1/providers/Microsoft.StreamAnalytics/streamingjobs/job1/outputs/output1