fix: use nested attribute assignment instead of dynamic blocks
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline failed

The prowlarr provider uses nested attributes for fields and categories,
not HCL blocks. Assign them directly as values.
This commit is contained in:
2026-06-28 22:27:57 +10:00
parent c08dc94b37
commit a59646c44a
2 changed files with 39 additions and 31 deletions
+14 -31
View File
@@ -7,42 +7,25 @@ resource "prowlarr_indexer" "this" {
for_each = var.indexers
name = each.key
enable = lookup(each.value, "enable", true)
app_profile_id = lookup(each.value, "app_profile_id", 1)
app_profile_id = each.value.app_profile_id
implementation = each.value.implementation
config_contract = each.value.config_contract
protocol = each.value.protocol
tags = lookup(each.value, "tags", [])
dynamic "fields" {
for_each = each.value.fields
content {
name = fields.value.name
text_value = lookup(fields.value, "text_value", null)
number_value = lookup(fields.value, "number_value", null)
bool_value = lookup(fields.value, "bool_value", null)
sensitive_value = lookup(fields.value, "sensitive_value", null)
}
}
fields = each.value.fields
}
resource "prowlarr_download_client_nzbget" "this" {
for_each = var.download_clients
name = each.key
enable = lookup(each.value, "enable", true)
priority = lookup(each.value, "priority", 1)
host = each.value.host
port = each.value.port
use_ssl = lookup(each.value, "use_ssl", false)
username = lookup(each.value, "username", "")
password = lookup(each.value, "password", "")
category = lookup(each.value, "category", "")
tags = lookup(each.value, "tags", [])
dynamic "categories" {
for_each = lookup(each.value, "categories", [])
content {
name = categories.value.name
categories = categories.value.categories
}
}
for_each = var.download_clients
name = each.key
enable = lookup(each.value, "enable", true)
priority = lookup(each.value, "priority", 1)
host = each.value.host
port = each.value.port
use_ssl = lookup(each.value, "use_ssl", false)
username = lookup(each.value, "username", "")
password = lookup(each.value, "password", "")
category = lookup(each.value, "category", "")
tags = lookup(each.value, "tags", [])
categories = lookup(each.value, "categories", [])
}