I am trying to import an Azure logic App workfow using terraform. My module is defined as below :
resource "azurerm_logic_app_workflow" "logic_app_workflow" {
for_each = var.logic_app_workflows
name = each.value["name"]
location = each.value["location"]
resource_group_name = each.value["resource_group_name"]
enabled = each.value["enabled"]
workflow_parameters = { for k,v in each.value["workflow_parameters"] : k =>jsonencode(v) }
tags = each.value["logic_app_workflow_tags"]
}
and my variable is defined as below :
variable "logic_app_workflows" {
type = map(object({
name = string
location = string
resource_group_name = string
enabled = bool
workflow_parameters = any
logic_app_workflow_tags = map(string)
}))
}
My tfvars file looks like this :
logic_app_workflows = {
logic_app_workflow1 = {
name = "test-logic"
location = "canadacentral"
resource_group_name = "test-rg"
enabled = true
workflow_parameters = {
connection = {
defaultValue = {}
type = "Object"
}
}
logic_app_workflow_tags = {
applicationName = "Logic App workflow"
}
}
}
I am getting the following output when I run terraform plan after importing the resource, I want my tfvars to able to not create/destroy/change anything, how do I fix it ?