From d7c4cb21315d888306ca5450d022200c753aa46b Mon Sep 17 00:00:00 2001
From: Agustin Celentano <12614595+agustincelentano@users.noreply.github.com>
Date: Tue, 14 Jul 2026 22:55:40 -0300
Subject: [PATCH] feat(agent_association): add configurable description input
for notification channels
Expose a new optional `description` variable in the parameter storage, scope
and service agent association modules, wiring it into the
nullplatform_notification_channel resource.
The parameter storage module previously hardcoded its channel description;
it now reads from var.description (default "") for consistency across the
three modules. Consumers relying on the old hardcoded text must set it
explicitly after upgrading.
---
.../README.md | 1 +
.../parameter_storage_definition_agent_association/main.tf | 2 +-
.../variables.tf | 6 ++++++
nullplatform/scope_definition_agent_association/README.md | 1 +
nullplatform/scope_definition_agent_association/main.tf | 7 ++++---
.../scope_definition_agent_association/variables.tf | 6 ++++++
.../service_definition_agent_association/README.md | 1 +
nullplatform/service_definition_agent_association/main.tf | 7 ++++---
.../service_definition_agent_association/variables.tf | 6 ++++++
9 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/nullplatform/parameter_storage_definition_agent_association/README.md b/nullplatform/parameter_storage_definition_agent_association/README.md
index e5cae39f..55864e4e 100644
--- a/nullplatform/parameter_storage_definition_agent_association/README.md
+++ b/nullplatform/parameter_storage_definition_agent_association/README.md
@@ -64,6 +64,7 @@ resource "example_resource" "this" {
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [api\_key](#input\_api\_key) | Agent API key for the notification channel. Rotating it recreates the channel (via terraform\_data.api\_key\_trigger). | `string` | n/a | yes |
+| [description](#input\_description) | Description shown for the notification channel. | `string` | `""` | no |
| [nrn](#input\_nrn) | NRN where the agent notification channel is anchored. | `string` | n/a | yes |
| [script\_path](#input\_script\_path) | Command line path the agent executes to handle parameter storage and retrieval. | `string` | `"nullplatform/parameters-provider/parameters/entrypoint"` | no |
| [tags\_selectors](#input\_tags\_selectors) | Map of tags the agent uses to select/filter this channel against scope tags (e.g. { environment = "production" }). | `map(string)` | `{}` | no |
diff --git a/nullplatform/parameter_storage_definition_agent_association/main.tf b/nullplatform/parameter_storage_definition_agent_association/main.tf
index 3d3839a9..6e9ecde2 100644
--- a/nullplatform/parameter_storage_definition_agent_association/main.tf
+++ b/nullplatform/parameter_storage_definition_agent_association/main.tf
@@ -6,7 +6,7 @@ resource "nullplatform_notification_channel" "from_template" {
nrn = var.nrn
type = "agent"
source = ["parameters"]
- description = "Notification channel to handle parameter storage and retrieval"
+ description = var.description
configuration {
agent {
api_key = var.api_key
diff --git a/nullplatform/parameter_storage_definition_agent_association/variables.tf b/nullplatform/parameter_storage_definition_agent_association/variables.tf
index 37159e1b..6ede1ebf 100644
--- a/nullplatform/parameter_storage_definition_agent_association/variables.tf
+++ b/nullplatform/parameter_storage_definition_agent_association/variables.tf
@@ -20,3 +20,9 @@ variable "script_path" {
type = string
default = "nullplatform/parameters-provider/parameters/entrypoint"
}
+
+variable "description" {
+ description = "Description shown for the notification channel."
+ type = string
+ default = ""
+}
diff --git a/nullplatform/scope_definition_agent_association/README.md b/nullplatform/scope_definition_agent_association/README.md
index 55ae29f3..934e2764 100644
--- a/nullplatform/scope_definition_agent_association/README.md
+++ b/nullplatform/scope_definition_agent_association/README.md
@@ -69,6 +69,7 @@ resource "example_resource" "this" {
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [api\_key](#input\_api\_key) | API key for authenticating with the nullplatform API | `string` | n/a | yes |
+| [description](#input\_description) | Description shown for the notification channel. | `string` | `""` | no |
| [enabled\_override](#input\_enabled\_override) | Enable custom overrides for scope configurations via command line | `bool` | `false` | no |
| [extra\_filters](#input\_extra\_filters) | Additional filter expression to merge with the base template filters using $and.
Accepts any valid MongoDB-style filter expression, including logical operators
($and, $or, $nor, $not) and comparison operators ($eq, $ne, $in, $nin, $gt,
$gte, $lt, $lte, $regex). If null, only the base template filters are applied.
Examples:
Simple equality: { "dimensions.environment" = "production" }
Comparison: { "action" = { "$in" = ["deployment:create", "deployment:update"] } }
Logical OR: { "$or" = [{ "details.namespace.slug" = "prod" }, { "details.namespace.slug" = "staging" }] }
Negation: { "$not" = { "entity\_data.status" = "failed" } }
Combined: { "$and" = [{ "action" = { "$regex" = "^deployment" } }, { "$or" = [...] }] } | `any` | `null` | no |
| [github\_ref](#input\_github\_ref) | Git reference to use (branch name, tag, or commit SHA) | `string` | `"beta"` | no |
diff --git a/nullplatform/scope_definition_agent_association/main.tf b/nullplatform/scope_definition_agent_association/main.tf
index ace6a45b..66697422 100644
--- a/nullplatform/scope_definition_agent_association/main.tf
+++ b/nullplatform/scope_definition_agent_association/main.tf
@@ -8,9 +8,10 @@ resource "terraform_data" "api_key_trigger" {
# Create notification channel with agent configuration and optional overrides
resource "nullplatform_notification_channel" "from_template" {
- nrn = var.nrn
- type = local.notification_channel_def.type
- source = local.notification_channel_def.source
+ nrn = var.nrn
+ type = local.notification_channel_def.type
+ source = local.notification_channel_def.source
+ description = var.description
configuration {
# Only configure agent block when notification channel type is "agent"
dynamic "agent" {
diff --git a/nullplatform/scope_definition_agent_association/variables.tf b/nullplatform/scope_definition_agent_association/variables.tf
index 80d0d8b1..602ac55c 100644
--- a/nullplatform/scope_definition_agent_association/variables.tf
+++ b/nullplatform/scope_definition_agent_association/variables.tf
@@ -80,6 +80,12 @@ variable "tags_selectors" {
type = map(string)
}
+variable "description" {
+ description = "Description shown for the notification channel."
+ type = string
+ default = ""
+}
+
variable "extra_filters" {
description = <<-EOT
Additional filter expression to merge with the base template filters using $and.
diff --git a/nullplatform/service_definition_agent_association/README.md b/nullplatform/service_definition_agent_association/README.md
index be3a5ac5..9f068677 100644
--- a/nullplatform/service_definition_agent_association/README.md
+++ b/nullplatform/service_definition_agent_association/README.md
@@ -69,6 +69,7 @@ resource "example_resource" "this" {
| [base\_clone\_path](#input\_base\_clone\_path) | Base path where the service repository is cloned inside the agent pod | `string` | `"/root/.np"` | no |
| [channel\_sources](#input\_channel\_sources) | List of sources for the notification channel (e.g., ['monitoring', 'alerts']) | `list(string)` |
[| no | | [channel\_type](#input\_channel\_type) | Type of the notification channel (e.g., 'agent') | `string` | `"agent"` | no | +| [description](#input\_description) | Description shown for the notification channel. | `string` | `""` | no | | [nrn](#input\_nrn) | Nullplatform Resource Name (organization:account format) | `string` | `null` | no | | [repository\_service\_spec\_repo](#input\_repository\_service\_spec\_repo) | GitHub repository name containing the service specs (used to build the agent cmdline path) | `string` | n/a | yes | | [service\_path](#input\_service\_path) | Path to the service directory within the repository (e.g., databases/postgres/k8s) | `string` | n/a | yes | diff --git a/nullplatform/service_definition_agent_association/main.tf b/nullplatform/service_definition_agent_association/main.tf index ef4bc910..09bcaeb0 100644 --- a/nullplatform/service_definition_agent_association/main.tf +++ b/nullplatform/service_definition_agent_association/main.tf @@ -4,9 +4,10 @@ resource "terraform_data" "api_key_trigger" { } resource "nullplatform_notification_channel" "channel_from_template" { - nrn = var.nrn - type = var.channel_type - source = var.channel_sources + nrn = var.nrn + type = var.channel_type + source = var.channel_sources + description = var.description configuration { diff --git a/nullplatform/service_definition_agent_association/variables.tf b/nullplatform/service_definition_agent_association/variables.tf index 90305b66..ad6beeb9 100644 --- a/nullplatform/service_definition_agent_association/variables.tf +++ b/nullplatform/service_definition_agent_association/variables.tf @@ -54,3 +54,9 @@ variable "agent_arguments" { default = [] description = "Arguments to pass to the agent entrypoint command" } + +variable "description" { + description = "Description shown for the notification channel." + type = string + default = "" +}
"service"
]