published on Wednesday, Oct 21, 2026 by incident-io
published on Wednesday, Oct 21, 2026 by incident-io
Create and manage announcement rules.
An announcement rule posts an announcement of each incident that matches its conditions into the channels it lists, rendered with an announcement template.
Use this data source to look up an existing announcement rule, either by id or by name, without managing it as an incident.AnnouncementRule resource. Set exactly one of the two lookup attributes; setting both, or neither, is rejected at plan time.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as incident from "@incident-io/pulumi";
// Look up an existing announcement rule by name, such as one created in the dashboard.
const critical = incident.getAnnouncementRule({
name: "Critical incidents",
});
// Or by ID, to reference a rule another module manages.
const payments = incident.getAnnouncementRule({
id: "01G0J1EXE7AXZ2C93K61WBPYEH",
});
export const criticalSlackChannelIds = critical.then(critical => critical.slackChannelIds);
import pulumi
import pulumi_incident as incident
# Look up an existing announcement rule by name, such as one created in the dashboard.
critical = incident.get_announcement_rule(name="Critical incidents")
# Or by ID, to reference a rule another module manages.
payments = incident.get_announcement_rule(id="01G0J1EXE7AXZ2C93K61WBPYEH")
pulumi.export("criticalSlackChannelIds", critical.slack_channel_ids)
package main
import (
"github.com/incident-io/pulumi-incident/sdk/go/incident"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Look up an existing announcement rule by name, such as one created in the dashboard.
critical, err := incident.GetAnnouncementRule(ctx, &incident.LookupAnnouncementRuleArgs{
Name: pulumi.StringRef("Critical incidents"),
}, nil)
if err != nil {
return err
}
// Or by ID, to reference a rule another module manages.
_, err = incident.GetAnnouncementRule(ctx, &incident.LookupAnnouncementRuleArgs{
Id: pulumi.StringRef("01G0J1EXE7AXZ2C93K61WBPYEH"),
}, nil)
if err != nil {
return err
}
ctx.Export("criticalSlackChannelIds", critical.SlackChannelIds)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Incident = Pulumi.Incident;
return await Deployment.RunAsync(() =>
{
// Look up an existing announcement rule by name, such as one created in the dashboard.
var critical = Incident.GetAnnouncementRule.Invoke(new()
{
Name = "Critical incidents",
});
// Or by ID, to reference a rule another module manages.
var payments = Incident.GetAnnouncementRule.Invoke(new()
{
Id = "01G0J1EXE7AXZ2C93K61WBPYEH",
});
return new Dictionary<string, object?>
{
["criticalSlackChannelIds"] = critical.Apply(getAnnouncementRuleResult => getAnnouncementRuleResult.SlackChannelIds),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.incident.IncidentFunctions;
import com.pulumi.incident.inputs.GetAnnouncementRuleArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
// Look up an existing announcement rule by name, such as one created in the dashboard.
final var critical = IncidentFunctions.getAnnouncementRule(GetAnnouncementRuleArgs.builder()
.name("Critical incidents")
.build());
// Or by ID, to reference a rule another module manages.
final var payments = IncidentFunctions.getAnnouncementRule(GetAnnouncementRuleArgs.builder()
.id("01G0J1EXE7AXZ2C93K61WBPYEH")
.build());
ctx.export("criticalSlackChannelIds", critical.slackChannelIds());
}
}
variables:
# Look up an existing announcement rule by name, such as one created in the dashboard.
critical:
fn::invoke:
function: incident:getAnnouncementRule
arguments:
name: Critical incidents
# Or by ID, to reference a rule another module manages.
payments:
fn::invoke:
function: incident:getAnnouncementRule
arguments:
id: 01G0J1EXE7AXZ2C93K61WBPYEH
outputs:
criticalSlackChannelIds: ${critical.slackChannelIds}
pulumi {
required_providers {
incident = {
source = "pulumi/incident"
}
}
}
data "incident_getannouncementrule" "critical" {
name = "Critical incidents"
}
data "incident_getannouncementrule" "payments" {
id = "01G0J1EXE7AXZ2C93K61WBPYEH"
}
# Look up an existing announcement rule by name, such as one created in the dashboard.
# Or by ID, to reference a rule another module manages.
output "criticalSlackChannelIds" {
value = data.incident_getannouncementrule.critical.slack_channel_ids
}
Using getAnnouncementRule
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 getAnnouncementRule(args: GetAnnouncementRuleArgs, opts?: InvokeOptions): Promise<GetAnnouncementRuleResult>
function getAnnouncementRuleOutput(args: GetAnnouncementRuleOutputArgs, opts?: InvokeOutputOptions): Output<GetAnnouncementRuleResult>def get_announcement_rule(id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAnnouncementRuleResult
def get_announcement_rule_output(id: pulumi.Input[Optional[str]] = None,
name: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetAnnouncementRuleResult]func LookupAnnouncementRule(ctx *Context, args *LookupAnnouncementRuleArgs, opts ...InvokeOption) (*LookupAnnouncementRuleResult, error)
func LookupAnnouncementRuleOutput(ctx *Context, args *LookupAnnouncementRuleOutputArgs, opts ...InvokeOption) LookupAnnouncementRuleResultOutput> Note: This function is named LookupAnnouncementRule in the Go SDK.
public static class GetAnnouncementRule
{
public static Task<GetAnnouncementRuleResult> InvokeAsync(GetAnnouncementRuleArgs args, InvokeOptions? opts = null)
public static Output<GetAnnouncementRuleResult> Invoke(GetAnnouncementRuleInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetAnnouncementRuleResult> Invoke(GetAnnouncementRuleInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetAnnouncementRuleResult> getAnnouncementRule(GetAnnouncementRuleArgs args, InvokeOptions options)
public static Output<GetAnnouncementRuleResult> getAnnouncementRule(GetAnnouncementRuleArgs args, InvokeOptions options)
public static Output<GetAnnouncementRuleResult> getAnnouncementRule(GetAnnouncementRuleArgs args, InvokeOutputOptions options)
fn::invoke:
function: incident:index/getAnnouncementRule:getAnnouncementRule
arguments:
# arguments dictionarydata "incident_get_announcement_rule" "name" {
# arguments
}The following arguments are supported:
getAnnouncementRule Result
The following output properties are available:
- Condition
Groups List<GetAnnouncement Rule Condition Group> - The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
- Conditions
No stringLonger Apply Behaviour - Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are:
leaveInPlace,remove. - Created
At string - When the rule was created
- Id string
- Unique identifier for this announcement rule
- Microsoft
Teams List<string>Channel Ids - Microsoft Teams channels to post announcements into, as teamid/channelid, when the organisation uses Microsoft Teams
- Mode string
- Which incidents are announced: live incidents only, or triage incidents too. Possible values are:
liveAndClosed,includeTriage,includeTriageAndMerged,includeDeclinedAndMerged,includeAll. - Name string
- Human readable name for the rule
- Owning
Team List<string>Ids - IDs of the teams that own this rule
- Private
Incident stringScope - Which private incidents this rule announces: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are:
all,owningTeams,none. - Slack
Channel List<string>Ids - IDs of the Slack channels to post announcements into, when the organisation uses Slack
- Template
Id string - ID of the announcement template used to render this rule's posts
- Update
Sharing stringMode - Where incident updates are shared once the incident is announced. Possible values are:
none,thread,threadAndChannel. - Updated
At string - When the rule was last updated
- Condition
Groups []GetAnnouncement Rule Condition Group - The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
- Conditions
No stringLonger Apply Behaviour - Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are:
leaveInPlace,remove. - Created
At string - When the rule was created
- Id string
- Unique identifier for this announcement rule
- Microsoft
Teams []stringChannel Ids - Microsoft Teams channels to post announcements into, as teamid/channelid, when the organisation uses Microsoft Teams
- Mode string
- Which incidents are announced: live incidents only, or triage incidents too. Possible values are:
liveAndClosed,includeTriage,includeTriageAndMerged,includeDeclinedAndMerged,includeAll. - Name string
- Human readable name for the rule
- Owning
Team []stringIds - IDs of the teams that own this rule
- Private
Incident stringScope - Which private incidents this rule announces: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are:
all,owningTeams,none. - Slack
Channel []stringIds - IDs of the Slack channels to post announcements into, when the organisation uses Slack
- Template
Id string - ID of the announcement template used to render this rule's posts
- Update
Sharing stringMode - Where incident updates are shared once the incident is announced. Possible values are:
none,thread,threadAndChannel. - Updated
At string - When the rule was last updated
- condition_
groups list(object) - The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
- conditions_
no_ stringlonger_ apply_ behaviour - Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are:
leaveInPlace,remove. - created_
at string - When the rule was created
- id string
- Unique identifier for this announcement rule
- microsoft_
teams_ list(string)channel_ ids - Microsoft Teams channels to post announcements into, as teamid/channelid, when the organisation uses Microsoft Teams
- mode string
- Which incidents are announced: live incidents only, or triage incidents too. Possible values are:
liveAndClosed,includeTriage,includeTriageAndMerged,includeDeclinedAndMerged,includeAll. - name string
- Human readable name for the rule
- owning_
team_ list(string)ids - IDs of the teams that own this rule
- private_
incident_ stringscope - Which private incidents this rule announces: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are:
all,owningTeams,none. - slack_
channel_ list(string)ids - IDs of the Slack channels to post announcements into, when the organisation uses Slack
- template_
id string - ID of the announcement template used to render this rule's posts
- update_
sharing_ stringmode - Where incident updates are shared once the incident is announced. Possible values are:
none,thread,threadAndChannel. - updated_
at string - When the rule was last updated
- condition
Groups List<GetAnnouncement Rule Condition Group> - The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
- conditions
No StringLonger Apply Behaviour - Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are:
leaveInPlace,remove. - created
At String - When the rule was created
- id String
- Unique identifier for this announcement rule
- microsoft
Teams List<String>Channel Ids - Microsoft Teams channels to post announcements into, as teamid/channelid, when the organisation uses Microsoft Teams
- mode String
- Which incidents are announced: live incidents only, or triage incidents too. Possible values are:
liveAndClosed,includeTriage,includeTriageAndMerged,includeDeclinedAndMerged,includeAll. - name String
- Human readable name for the rule
- owning
Team List<String>Ids - IDs of the teams that own this rule
- private
Incident StringScope - Which private incidents this rule announces: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are:
all,owningTeams,none. - slack
Channel List<String>Ids - IDs of the Slack channels to post announcements into, when the organisation uses Slack
- template
Id String - ID of the announcement template used to render this rule's posts
- update
Sharing StringMode - Where incident updates are shared once the incident is announced. Possible values are:
none,thread,threadAndChannel. - updated
At String - When the rule was last updated
- condition
Groups GetAnnouncement Rule Condition Group[] - The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
- conditions
No stringLonger Apply Behaviour - Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are:
leaveInPlace,remove. - created
At string - When the rule was created
- id string
- Unique identifier for this announcement rule
- microsoft
Teams string[]Channel Ids - Microsoft Teams channels to post announcements into, as teamid/channelid, when the organisation uses Microsoft Teams
- mode string
- Which incidents are announced: live incidents only, or triage incidents too. Possible values are:
liveAndClosed,includeTriage,includeTriageAndMerged,includeDeclinedAndMerged,includeAll. - name string
- Human readable name for the rule
- owning
Team string[]Ids - IDs of the teams that own this rule
- private
Incident stringScope - Which private incidents this rule announces: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are:
all,owningTeams,none. - slack
Channel string[]Ids - IDs of the Slack channels to post announcements into, when the organisation uses Slack
- template
Id string - ID of the announcement template used to render this rule's posts
- update
Sharing stringMode - Where incident updates are shared once the incident is announced. Possible values are:
none,thread,threadAndChannel. - updated
At string - When the rule was last updated
- condition_
groups Sequence[GetAnnouncement Rule Condition Group] - The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
- conditions_
no_ strlonger_ apply_ behaviour - Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are:
leaveInPlace,remove. - created_
at str - When the rule was created
- id str
- Unique identifier for this announcement rule
- microsoft_
teams_ Sequence[str]channel_ ids - Microsoft Teams channels to post announcements into, as teamid/channelid, when the organisation uses Microsoft Teams
- mode str
- Which incidents are announced: live incidents only, or triage incidents too. Possible values are:
liveAndClosed,includeTriage,includeTriageAndMerged,includeDeclinedAndMerged,includeAll. - name str
- Human readable name for the rule
- owning_
team_ Sequence[str]ids - IDs of the teams that own this rule
- private_
incident_ strscope - Which private incidents this rule announces: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are:
all,owningTeams,none. - slack_
channel_ Sequence[str]ids - IDs of the Slack channels to post announcements into, when the organisation uses Slack
- template_
id str - ID of the announcement template used to render this rule's posts
- update_
sharing_ strmode - Where incident updates are shared once the incident is announced. Possible values are:
none,thread,threadAndChannel. - updated_
at str - When the rule was last updated
- condition
Groups List<Property Map> - The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
- conditions
No StringLonger Apply Behaviour - Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are:
leaveInPlace,remove. - created
At String - When the rule was created
- id String
- Unique identifier for this announcement rule
- microsoft
Teams List<String>Channel Ids - Microsoft Teams channels to post announcements into, as teamid/channelid, when the organisation uses Microsoft Teams
- mode String
- Which incidents are announced: live incidents only, or triage incidents too. Possible values are:
liveAndClosed,includeTriage,includeTriageAndMerged,includeDeclinedAndMerged,includeAll. - name String
- Human readable name for the rule
- owning
Team List<String>Ids - IDs of the teams that own this rule
- private
Incident StringScope - Which private incidents this rule announces: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are:
all,owningTeams,none. - slack
Channel List<String>Ids - IDs of the Slack channels to post announcements into, when the organisation uses Slack
- template
Id String - ID of the announcement template used to render this rule's posts
- update
Sharing StringMode - Where incident updates are shared once the incident is announced. Possible values are:
none,thread,threadAndChannel. - updated
At String - When the rule was last updated
Supporting Types
GetAnnouncementRuleConditionGroup
- Conditions
List<Get
Announcement Rule Condition Group Condition> - All conditions in this list must be satisfied for the group to be satisfied
- Conditions
[]Get
Announcement Rule Condition Group Condition - All conditions in this list must be satisfied for the group to be satisfied
- conditions list(object)
- All conditions in this list must be satisfied for the group to be satisfied
- conditions
List<Get
Announcement Rule Condition Group Condition> - All conditions in this list must be satisfied for the group to be satisfied
- conditions
Get
Announcement Rule Condition Group Condition[] - All conditions in this list must be satisfied for the group to be satisfied
- conditions
Sequence[Get
Announcement Rule Condition Group Condition] - All conditions in this list must be satisfied for the group to be satisfied
- conditions List<Property Map>
- All conditions in this list must be satisfied for the group to be satisfied
GetAnnouncementRuleConditionGroupCondition
- Operation string
- Param
Bindings List<GetAnnouncement Rule Condition Group Condition Param Binding> - Bindings for the operation parameters
- Subject string
- Operation string
- Param
Bindings []GetAnnouncement Rule Condition Group Condition Param Binding - Bindings for the operation parameters
- Subject string
- operation string
- param_
bindings list(object) - Bindings for the operation parameters
- subject string
- operation String
- param
Bindings List<GetAnnouncement Rule Condition Group Condition Param Binding> - Bindings for the operation parameters
- subject String
- operation string
- param
Bindings GetAnnouncement Rule Condition Group Condition Param Binding[] - Bindings for the operation parameters
- subject string
- operation str
- param_
bindings Sequence[GetAnnouncement Rule Condition Group Condition Param Binding] - Bindings for the operation parameters
- subject str
- operation String
- param
Bindings List<Property Map> - Bindings for the operation parameters
- subject String
GetAnnouncementRuleConditionGroupConditionParamBinding
- Array
Values List<GetAnnouncement Rule Condition Group Condition Param Binding Array Value> - If array*value is set, this helps render the values
- Expression
Ref string - Value
Get
Announcement Rule Condition Group Condition Param Binding Value - Value
Literal string - Value
Reference string - Values List<string>
- Array
Values []GetAnnouncement Rule Condition Group Condition Param Binding Array Value - If array*value is set, this helps render the values
- Expression
Ref string - Value
Get
Announcement Rule Condition Group Condition Param Binding Value - Value
Literal string - Value
Reference string - Values []string
- array_
values list(object) - If array*value is set, this helps render the values
- expression_
ref string - value object
- value_
literal string - value_
reference string - values list(string)
- array
Values List<GetAnnouncement Rule Condition Group Condition Param Binding Array Value> - If array*value is set, this helps render the values
- expression
Ref String - value
Get
Announcement Rule Condition Group Condition Param Binding Value - value
Literal String - value
Reference String - values List<String>
- array
Values GetAnnouncement Rule Condition Group Condition Param Binding Array Value[] - If array*value is set, this helps render the values
- expression
Ref string - value
Get
Announcement Rule Condition Group Condition Param Binding Value - value
Literal string - value
Reference string - values string[]
- array_
values Sequence[GetAnnouncement Rule Condition Group Condition Param Binding Array Value] - If array*value is set, this helps render the values
- expression_
ref str - value
Get
Announcement Rule Condition Group Condition Param Binding Value - value_
literal str - value_
reference str - values Sequence[str]
- array
Values List<Property Map> - If array*value is set, this helps render the values
- expression
Ref String - value Property Map
- value
Literal String - value
Reference String - values List<String>
GetAnnouncementRuleConditionGroupConditionParamBindingArrayValue
GetAnnouncementRuleConditionGroupConditionParamBindingValue
Package Details
- Repository
- incident incident-io/pulumi-incident
- License
- MIT
- Notes
- This Pulumi package is based on the
incidentTerraform Provider.
published on Wednesday, Oct 21, 2026 by incident-io