Hello, I created a module for consumption based logic app and everything deployed using only the required attributes from Terraform. I am now trying to add parameters and workflow_parameters to my module, however I am running into an issue. Below I am trying to hard code in parameters to be used in my logic app, however Im running into issues. My goal is to provide these values via a variable file, but for now hard coded values will do for testing.
Module -
data “azurerm_resource_group” “rg” {
name = var.resource_group_name
}
resource “azurerm_logic_app_workflow” “consumption” {
name = “la-{var.service_name}-{var.environment}-${var.iteration}”
resource_group_name = data.azurerm_resource_group.rg.name
location = data.azurerm_resource_group.rg.location
dynamic access_control {
for_each = length(var.access_control) > 0 ? var.access_control : {}
content {
action{
allowed_caller_ip_address_range = each.value.action.allowed_caller_ip_address_range
}
content {
allowed_caller_ip_address_range = each.value.content.allowed_caller_ip_address_range
}
trigger {
allowed_caller_ip_address_range = each.value.trigger.allowed_caller_ip_address_range
open_authentication_policy {
name = each.value.trigger.open_authentication_policy.name
claim {
name = each.value.trigger.open_authentication_policy.claim.name
value = each.value.trigger.open_authentication_policy.claim.value
}
}
}
workflow_management {
allowed_caller_ip_address_range = each.value.workflow_management.allowed_caller_ip_address_range
}
}
}
dynamic “identity” {
for_each = var.identities != null ? var.identities : {}
content {
type = each.value.type
identity_ids = each.value.identity_ids
}
}
integration_service_environment_id = var.integration_service_environment_id
logic_app_integration_account_id = var.logic_app_integration_account_id
enabled = var.enabled
//workflow_parameters = var.workflow_parameters
//parameters = var.parameters
workflow_schema = var.workflow_schema
workflow_version = var.workflow_version
// Use variables if provided, otherwise fall back to defaults
workflow_parameters = {
“TestParam” = “{"type":"string","defaultValue":"default value"}”
}
parameters = {
"TestParam" = "hello there"
}
}
Error : flattening parameters
: the value of parameter TestParam is expected to be bool, but got nil
My overall goal is for all users to input these values into their tfvars file and have the parameters and workflow parameters created via terraform. Any help or examples would be very much appreciated!!! A basic explanation on how to get parameters created would be amazing. Thanks for taking the time to read my post!