'terraform azurerm_data_factory_pipeline assing type to the variables

in terraform documentation i found the follow example:

resource "azurerm_data_factory_pipeline" "test" {
  name                = .....
  resource_group_name = ...
  data_factory_id     = ...
  variables = {
  "bob" = "item1"
}

but I need to create a boolean variable, in the portal Azure I have the type field. how can I set the variable like this:

"variables": {
  "END": {
    "type": "Boolean",
    "defaultValue": false
  }
}


Solution 1:[1]

Based on your question, if you are asking how to create a variable of type boolean in Terraform, that is done like this:

variable "END" {
  type        = bool
  description = "End variable."

  default = false
}

You can reference that variable then in the resource definition:

resource "azurerm_data_factory_pipeline" "test" {
  name                = .....
  resource_group_name = ...
  data_factory_id     = ...
  
  variables = {
    "END" = var.END
  }
}

Or alternatively you can set it without defining the Terraform variable like this:

resource "azurerm_data_factory_pipeline" "test" {
  name                = .....
  resource_group_name = ...
  data_factory_id     = ...
  
  variables = {
    "END" = false
  }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marko E