diff --git a/main.tf b/main.tf index e054c4e..8b9e978 100644 --- a/main.tf +++ b/main.tf @@ -195,10 +195,13 @@ resource "aws_transfer_server" "transfer_server" { security_policy_name = var.security_policy_name logging_role = join("", aws_iam_role.logging[*].arn) tags = module.labels.tags - workflow_details { - on_upload { - execution_role = var.workflow_details.on_upload.execution_role - workflow_id = var.workflow_details.on_upload.workflow_id + dynamic "workflow_details" { + for_each = var.enable_workflow ? [1] : [] + content { + on_upload { + execution_role = var.workflow_details.on_upload.execution_role + workflow_id = var.workflow_details.on_upload.workflow_id + } } } dynamic "endpoint_details" { diff --git a/variables.tf b/variables.tf index 8d4fe97..9ada657 100644 --- a/variables.tf +++ b/variables.tf @@ -186,4 +186,9 @@ variable "workflow_details" { }) }) description = "Workflow details for triggering the execution on file upload." +} + +variable "enable_workflow" { + type = bool + default = false } \ No newline at end of file