diff --git a/terraform/stream-analytics/stream-analytics-job/main.tf b/terraform/stream-analytics/stream-analytics-job/main.tf index dfe0f7d4..0fbaed8c 100644 --- a/terraform/stream-analytics/stream-analytics-job/main.tf +++ b/terraform/stream-analytics/stream-analytics-job/main.tf @@ -1,10 +1,9 @@ # https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/stream_analytics_job resource "azurerm_stream_analytics_job" "adl_asa" { - name = "asa-${var.basename}" - resource_group_name = var.rg_name - location = var.location - + name = "asa-${var.basename}" + resource_group_name = var.rg_name + location = var.location compatibility_level = var.compatibility_level data_locale = var.data_locale events_late_arrival_max_delay_in_seconds = var.events_late_arrival_max_delay_in_seconds @@ -12,12 +11,12 @@ resource "azurerm_stream_analytics_job" "adl_asa" { events_out_of_order_policy = var.events_out_of_order_policy output_error_policy = var.output_error_policy streaming_units = var.streaming_units - - tags = var.tags - - transformation_query = < 0 ? + azurerm_stream_analytics_job.adl_asa[0].id : "" + ) } output "name" { - value = azurerm_stream_analytics_job.adl_asa.name + value = ( + length(azurerm_stream_analytics_job.adl_asa) > 0 ? + azurerm_stream_analytics_job.adl_asa[0].name : "" + ) } output "resource_group_name" { - value = azurerm_stream_analytics_job.adl_asa.resource_group_name + value = ( + length(azurerm_stream_analytics_job.adl_asa) > 0 ? + azurerm_stream_analytics_job.adl_asa[0].resource_group_name : "" + ) } \ No newline at end of file diff --git a/terraform/stream-analytics/stream-analytics-job/variables.tf b/terraform/stream-analytics/stream-analytics-job/variables.tf index 00f2e653..740d9ea7 100644 --- a/terraform/stream-analytics/stream-analytics-job/variables.tf +++ b/terraform/stream-analytics/stream-analytics-job/variables.tf @@ -23,6 +23,12 @@ variable "tags" { description = "A mapping of tags which should be assigned to the deployed resource." } +variable "module_enabled" { + type = bool + description = "Variable to enable or disable the module." + default = true +} + variable "compatibility_level" { type = string description = "Specifies the compatibility level for this job - which controls certain runtime behaviours of the streaming job."