Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ resource "example_resource" "this" {
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_api_key"></a> [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 |
| <a name="input_description"></a> [description](#input\_description) | Description shown for the notification channel. | `string` | `""` | no |
| <a name="input_nrn"></a> [nrn](#input\_nrn) | NRN where the agent notification channel is anchored. | `string` | n/a | yes |
| <a name="input_script_path"></a> [script\_path](#input\_script\_path) | Command line path the agent executes to handle parameter storage and retrieval. | `string` | `"nullplatform/parameters-provider/parameters/entrypoint"` | no |
| <a name="input_tags_selectors"></a> [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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}
1 change: 1 addition & 0 deletions nullplatform/scope_definition_agent_association/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ resource "example_resource" "this" {
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_api_key"></a> [api\_key](#input\_api\_key) | API key for authenticating with the nullplatform API | `string` | n/a | yes |
| <a name="input_description"></a> [description](#input\_description) | Description shown for the notification channel. | `string` | `""` | no |
| <a name="input_enabled_override"></a> [enabled\_override](#input\_enabled\_override) | Enable custom overrides for scope configurations via command line | `bool` | `false` | no |
| <a name="input_extra_filters"></a> [extra\_filters](#input\_extra\_filters) | Additional filter expression to merge with the base template filters using $and.<br/>Accepts any valid MongoDB-style filter expression, including logical operators<br/>($and, $or, $nor, $not) and comparison operators ($eq, $ne, $in, $nin, $gt,<br/>$gte, $lt, $lte, $regex). If null, only the base template filters are applied.<br/><br/>Examples:<br/> Simple equality: { "dimensions.environment" = "production" }<br/> Comparison: { "action" = { "$in" = ["deployment:create", "deployment:update"] } }<br/> Logical OR: { "$or" = [{ "details.namespace.slug" = "prod" }, { "details.namespace.slug" = "staging" }] }<br/> Negation: { "$not" = { "entity\_data.status" = "failed" } }<br/> Combined: { "$and" = [{ "action" = { "$regex" = "^deployment" } }, { "$or" = [...] }] } | `any` | `null` | no |
| <a name="input_github_ref"></a> [github\_ref](#input\_github\_ref) | Git reference to use (branch name, tag, or commit SHA) | `string` | `"beta"` | no |
Expand Down
7 changes: 4 additions & 3 deletions nullplatform/scope_definition_agent_association/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
6 changes: 6 additions & 0 deletions nullplatform/scope_definition_agent_association/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ resource "example_resource" "this" {
| <a name="input_base_clone_path"></a> [base\_clone\_path](#input\_base\_clone\_path) | Base path where the service repository is cloned inside the agent pod | `string` | `"/root/.np"` | no |
| <a name="input_channel_sources"></a> [channel\_sources](#input\_channel\_sources) | List of sources for the notification channel (e.g., ['monitoring', 'alerts']) | `list(string)` | <pre>[<br/> "service"<br/>]</pre> | no |
| <a name="input_channel_type"></a> [channel\_type](#input\_channel\_type) | Type of the notification channel (e.g., 'agent') | `string` | `"agent"` | no |
| <a name="input_description"></a> [description](#input\_description) | Description shown for the notification channel. | `string` | `""` | no |
| <a name="input_nrn"></a> [nrn](#input\_nrn) | Nullplatform Resource Name (organization:account format) | `string` | `null` | no |
| <a name="input_repository_service_spec_repo"></a> [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 |
| <a name="input_service_path"></a> [service\_path](#input\_service\_path) | Path to the service directory within the repository (e.g., databases/postgres/k8s) | `string` | n/a | yes |
Expand Down
7 changes: 4 additions & 3 deletions nullplatform/service_definition_agent_association/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}