published on Wednesday, Nov 4, 2026 by e-breuninger
published on Wednesday, Nov 4, 2026 by e-breuninger
A NetBox event rule (extras.eventrule): runs a webhook or a script when objects of the given types change.
From the official documentation:
NetBox can be configured via Event Rules to transmit outgoing webhooks to remote systems in response to internal object changes. The receiver can act on the data in these webhook messages to perform related tasks. Event rules can also execute custom scripts, enabling NetBox to run defined logic locally in response to object changes.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const test = netbox.getEventRule({
name: "test-event_rule",
});
import pulumi
import pulumi_netbox as netbox
test = netbox.get_event_rule(name="test-event_rule")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v6/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := netbox.LookupEventRule(ctx, &netbox.LookupEventRuleArgs{
Name: pulumi.StringRef("test-event_rule"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var test = Netbox.GetEventRule.Invoke(new()
{
Name = "test-event_rule",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.NetboxFunctions;
import com.pulumi.netbox.inputs.GetEventRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var test = NetboxFunctions.getEventRule(GetEventRuleArgs.builder()
.name("test-event_rule")
.build());
}
}
variables:
test:
fn::invoke:
function: netbox:getEventRule
arguments:
name: test-event_rule
Example coming soon!
Using getEventRule
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getEventRule(args: GetEventRuleArgs, opts?: InvokeOptions): Promise<GetEventRuleResult>
function getEventRuleOutput(args: GetEventRuleOutputArgs, opts?: InvokeOutputOptions): Output<GetEventRuleResult>def get_event_rule(action_type: Optional[str] = None,
custom_field_filters: Optional[Mapping[str, str]] = None,
enabled: Optional[bool] = None,
id: Optional[float] = None,
name: Optional[str] = None,
owner_id: Optional[float] = None,
tag_slug: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetEventRuleResult
def get_event_rule_output(action_type: pulumi.Input[Optional[str]] = None,
custom_field_filters: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
enabled: pulumi.Input[Optional[bool]] = None,
id: pulumi.Input[Optional[float]] = None,
name: pulumi.Input[Optional[str]] = None,
owner_id: pulumi.Input[Optional[float]] = None,
tag_slug: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetEventRuleResult]func LookupEventRule(ctx *Context, args *LookupEventRuleArgs, opts ...InvokeOption) (*LookupEventRuleResult, error)
func LookupEventRuleOutput(ctx *Context, args *LookupEventRuleOutputArgs, opts ...InvokeOption) LookupEventRuleResultOutput> Note: This function is named LookupEventRule in the Go SDK.
public static class GetEventRule
{
public static Task<GetEventRuleResult> InvokeAsync(GetEventRuleArgs args, InvokeOptions? opts = null)
public static Output<GetEventRuleResult> Invoke(GetEventRuleInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetEventRuleResult> Invoke(GetEventRuleInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetEventRuleResult> getEventRule(GetEventRuleArgs args, InvokeOptions options)
public static Output<GetEventRuleResult> getEventRule(GetEventRuleArgs args, InvokeOptions options)
public static Output<GetEventRuleResult> getEventRule(GetEventRuleArgs args, InvokeOutputOptions options)
fn::invoke:
function: netbox:index/getEventRule:getEventRule
arguments:
# arguments dictionarydata "netbox_get_event_rule" "name" {
# arguments
}The following arguments are supported:
- Action
Type string - What the rule runs. One of: webhook, script, notification.
- Custom
Field Dictionary<string, string>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- Enabled bool
- Whether the rule fires.
- Id double
- NetBox id.
- Name string
- Owner
Id double - Id of the owner the object is assigned to.
- string
- Slug of a tag the object carries.
- Action
Type string - What the rule runs. One of: webhook, script, notification.
- Custom
Field map[string]stringFilters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- Enabled bool
- Whether the rule fires.
- Id float64
- NetBox id.
- Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- string
- Slug of a tag the object carries.
- action_
type string - What the rule runs. One of: webhook, script, notification.
- custom_
field_ map(string)filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- enabled bool
- Whether the rule fires.
- id number
- NetBox id.
- name string
- owner_
id number - Id of the owner the object is assigned to.
- tag_
slug string - Slug of a tag the object carries.
- action
Type String - What the rule runs. One of: webhook, script, notification.
- custom
Field Map<String,String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- enabled Boolean
- Whether the rule fires.
- id Double
- NetBox id.
- name String
- owner
Id Double - Id of the owner the object is assigned to.
- String
- Slug of a tag the object carries.
- action
Type string - What the rule runs. One of: webhook, script, notification.
- custom
Field {[key: string]: string}Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- enabled boolean
- Whether the rule fires.
- id number
- NetBox id.
- name string
- owner
Id number - Id of the owner the object is assigned to.
- string
- Slug of a tag the object carries.
- action_
type str - What the rule runs. One of: webhook, script, notification.
- custom_
field_ Mapping[str, str]filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- enabled bool
- Whether the rule fires.
- id float
- NetBox id.
- name str
- owner_
id float - Id of the owner the object is assigned to.
- tag_
slug str - Slug of a tag the object carries.
- action
Type String - What the rule runs. One of: webhook, script, notification.
- custom
Field Map<String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- enabled Boolean
- Whether the rule fires.
- id Number
- NetBox id.
- name String
- owner
Id Number - Id of the owner the object is assigned to.
- String
- Slug of a tag the object carries.
getEventRule Result
The following output properties are available:
- Action
Object doubleId - Id of the webhook or script to run.
- Action
Object stringType - Content type of the action object: extras.webhook or extras.script.
- Action
Type string - What the rule runs. One of: webhook, script, notification.
- Conditions string
- Conditions the changed object must satisfy, as JSON text (use jsonencode()).
- Created string
- Custom
Fields Dictionary<string, string> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Enabled bool
- Whether the rule fires.
- Event
Types List<string> - Events that trigger the rule: objectcreated, objectupdated, objectdeleted, jobstarted, jobcompleted, jobfailed or job_errored.
- Id double
- NetBox id.
- Last
Updated string - Name string
- Object
Types List<string> - Object types the rule watches, as app-labelled content types (dcim.device).
- Owner
Id double - Id of the owner the object is assigned to.
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<string>
- Slugs of all tags on the object, including the provider's default_tags.
- Url string
- Custom
Field Dictionary<string, string>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- string
- Slug of a tag the object carries.
- Action
Object float64Id - Id of the webhook or script to run.
- Action
Object stringType - Content type of the action object: extras.webhook or extras.script.
- Action
Type string - What the rule runs. One of: webhook, script, notification.
- Conditions string
- Conditions the changed object must satisfy, as JSON text (use jsonencode()).
- Created string
- Custom
Fields map[string]string - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Enabled bool
- Whether the rule fires.
- Event
Types []string - Events that trigger the rule: objectcreated, objectupdated, objectdeleted, jobstarted, jobcompleted, jobfailed or job_errored.
- Id float64
- NetBox id.
- Last
Updated string - Name string
- Object
Types []string - Object types the rule watches, as app-labelled content types (dcim.device).
- Owner
Id float64 - Id of the owner the object is assigned to.
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- []string
- Slugs of all tags on the object, including the provider's default_tags.
- Url string
- Custom
Field map[string]stringFilters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- string
- Slug of a tag the object carries.
- action_
object_ numberid - Id of the webhook or script to run.
- action_
object_ stringtype - Content type of the action object: extras.webhook or extras.script.
- action_
type string - What the rule runs. One of: webhook, script, notification.
- conditions string
- Conditions the changed object must satisfy, as JSON text (use jsonencode()).
- created string
- custom_
fields map(string) - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- enabled bool
- Whether the rule fires.
- event_
types list(string) - Events that trigger the rule: objectcreated, objectupdated, objectdeleted, jobstarted, jobcompleted, jobfailed or job_errored.
- id number
- NetBox id.
- last_
updated string - name string
- object_
types list(string) - Object types the rule watches, as app-labelled content types (dcim.device).
- owner_
id number - Id of the owner the object is assigned to.
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- list(string)
- Slugs of all tags on the object, including the provider's default_tags.
- url string
- custom_
field_ map(string)filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- tag_
slug string - Slug of a tag the object carries.
- action
Object DoubleId - Id of the webhook or script to run.
- action
Object StringType - Content type of the action object: extras.webhook or extras.script.
- action
Type String - What the rule runs. One of: webhook, script, notification.
- conditions String
- Conditions the changed object must satisfy, as JSON text (use jsonencode()).
- created String
- custom
Fields Map<String,String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- enabled Boolean
- Whether the rule fires.
- event
Types List<String> - Events that trigger the rule: objectcreated, objectupdated, objectdeleted, jobstarted, jobcompleted, jobfailed or job_errored.
- id Double
- NetBox id.
- last
Updated String - name String
- object
Types List<String> - Object types the rule watches, as app-labelled content types (dcim.device).
- owner
Id Double - Id of the owner the object is assigned to.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- url String
- custom
Field Map<String,String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- String
- Slug of a tag the object carries.
- action
Object numberId - Id of the webhook or script to run.
- action
Object stringType - Content type of the action object: extras.webhook or extras.script.
- action
Type string - What the rule runs. One of: webhook, script, notification.
- conditions string
- Conditions the changed object must satisfy, as JSON text (use jsonencode()).
- created string
- custom
Fields {[key: string]: string} - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- enabled boolean
- Whether the rule fires.
- event
Types string[] - Events that trigger the rule: objectcreated, objectupdated, objectdeleted, jobstarted, jobcompleted, jobfailed or job_errored.
- id number
- NetBox id.
- last
Updated string - name string
- object
Types string[] - Object types the rule watches, as app-labelled content types (dcim.device).
- owner
Id number - Id of the owner the object is assigned to.
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- string[]
- Slugs of all tags on the object, including the provider's default_tags.
- url string
- custom
Field {[key: string]: string}Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- string
- Slug of a tag the object carries.
- action_
object_ floatid - Id of the webhook or script to run.
- action_
object_ strtype - Content type of the action object: extras.webhook or extras.script.
- action_
type str - What the rule runs. One of: webhook, script, notification.
- conditions str
- Conditions the changed object must satisfy, as JSON text (use jsonencode()).
- created str
- custom_
fields Mapping[str, str] - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description str
- enabled bool
- Whether the rule fires.
- event_
types Sequence[str] - Events that trigger the rule: objectcreated, objectupdated, objectdeleted, jobstarted, jobcompleted, jobfailed or job_errored.
- id float
- NetBox id.
- last_
updated str - name str
- object_
types Sequence[str] - Object types the rule watches, as app-labelled content types (dcim.device).
- owner_
id float - Id of the owner the object is assigned to.
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Sequence[str]
- Slugs of all tags on the object, including the provider's default_tags.
- url str
- custom_
field_ Mapping[str, str]filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- tag_
slug str - Slug of a tag the object carries.
- action
Object NumberId - Id of the webhook or script to run.
- action
Object StringType - Content type of the action object: extras.webhook or extras.script.
- action
Type String - What the rule runs. One of: webhook, script, notification.
- conditions String
- Conditions the changed object must satisfy, as JSON text (use jsonencode()).
- created String
- custom
Fields Map<String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- enabled Boolean
- Whether the rule fires.
- event
Types List<String> - Events that trigger the rule: objectcreated, objectupdated, objectdeleted, jobstarted, jobcompleted, jobfailed or job_errored.
- id Number
- NetBox id.
- last
Updated String - name String
- object
Types List<String> - Object types the rule watches, as app-labelled content types (dcim.device).
- owner
Id Number - Id of the owner the object is assigned to.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- url String
- custom
Field Map<String>Filters - Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
- String
- Slug of a tag the object carries.
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netboxTerraform Provider.
published on Wednesday, Nov 4, 2026 by e-breuninger