1. Registry
  2. Packages
  3. incident.io
  4. API Docs
  5. getAnnouncementRule
Viewing docs for incident.io v0.4.1
published on Wednesday, Oct 21, 2026 by incident-io
incident logo incident.io
Viewing docs for incident.io v0.4.1
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 dictionary
    data "incident_get_announcement_rule" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    Unique identifier for this announcement rule
    Name string
    Human readable name for the rule
    Id string
    Unique identifier for this announcement rule
    Name string
    Human readable name for the rule
    id string
    Unique identifier for this announcement rule
    name string
    Human readable name for the rule
    id String
    Unique identifier for this announcement rule
    name String
    Human readable name for the rule
    id string
    Unique identifier for this announcement rule
    name string
    Human readable name for the rule
    id str
    Unique identifier for this announcement rule
    name str
    Human readable name for the rule
    id String
    Unique identifier for this announcement rule
    name String
    Human readable name for the rule

    getAnnouncementRule Result

    The following output properties are available:

    ConditionGroups List<GetAnnouncementRuleConditionGroup>
    The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
    ConditionsNoLongerApplyBehaviour string
    Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are: leaveInPlace, remove.
    CreatedAt string
    When the rule was created
    Id string
    Unique identifier for this announcement rule
    MicrosoftTeamsChannelIds List<string>
    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
    OwningTeamIds List<string>
    IDs of the teams that own this rule
    PrivateIncidentScope string
    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.
    SlackChannelIds List<string>
    IDs of the Slack channels to post announcements into, when the organisation uses Slack
    TemplateId string
    ID of the announcement template used to render this rule's posts
    UpdateSharingMode string
    Where incident updates are shared once the incident is announced. Possible values are: none, thread, threadAndChannel.
    UpdatedAt string
    When the rule was last updated
    ConditionGroups []GetAnnouncementRuleConditionGroup
    The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
    ConditionsNoLongerApplyBehaviour string
    Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are: leaveInPlace, remove.
    CreatedAt string
    When the rule was created
    Id string
    Unique identifier for this announcement rule
    MicrosoftTeamsChannelIds []string
    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
    OwningTeamIds []string
    IDs of the teams that own this rule
    PrivateIncidentScope string
    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.
    SlackChannelIds []string
    IDs of the Slack channels to post announcements into, when the organisation uses Slack
    TemplateId string
    ID of the announcement template used to render this rule's posts
    UpdateSharingMode string
    Where incident updates are shared once the incident is announced. Possible values are: none, thread, threadAndChannel.
    UpdatedAt 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_longer_apply_behaviour string
    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_channel_ids list(string)
    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_ids list(string)
    IDs of the teams that own this rule
    private_incident_scope string
    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_ids list(string)
    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_mode string
    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
    conditionGroups List<GetAnnouncementRuleConditionGroup>
    The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
    conditionsNoLongerApplyBehaviour String
    Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are: leaveInPlace, remove.
    createdAt String
    When the rule was created
    id String
    Unique identifier for this announcement rule
    microsoftTeamsChannelIds List<String>
    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
    owningTeamIds List<String>
    IDs of the teams that own this rule
    privateIncidentScope String
    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.
    slackChannelIds List<String>
    IDs of the Slack channels to post announcements into, when the organisation uses Slack
    templateId String
    ID of the announcement template used to render this rule's posts
    updateSharingMode String
    Where incident updates are shared once the incident is announced. Possible values are: none, thread, threadAndChannel.
    updatedAt String
    When the rule was last updated
    conditionGroups GetAnnouncementRuleConditionGroup[]
    The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
    conditionsNoLongerApplyBehaviour string
    Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are: leaveInPlace, remove.
    createdAt string
    When the rule was created
    id string
    Unique identifier for this announcement rule
    microsoftTeamsChannelIds string[]
    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
    owningTeamIds string[]
    IDs of the teams that own this rule
    privateIncidentScope string
    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.
    slackChannelIds string[]
    IDs of the Slack channels to post announcements into, when the organisation uses Slack
    templateId string
    ID of the announcement template used to render this rule's posts
    updateSharingMode string
    Where incident updates are shared once the incident is announced. Possible values are: none, thread, threadAndChannel.
    updatedAt string
    When the rule was last updated
    condition_groups Sequence[GetAnnouncementRuleConditionGroup]
    The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
    conditions_no_longer_apply_behaviour str
    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_channel_ids Sequence[str]
    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_ids Sequence[str]
    IDs of the teams that own this rule
    private_incident_scope str
    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_ids Sequence[str]
    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_mode str
    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
    conditionGroups List<Property Map>
    The condition groups to apply in this filter. Only one group needs to be satisfied for the filter to pass.
    conditionsNoLongerApplyBehaviour String
    Whether to remove announcement posts when the incident no longer matches this rule's conditions. Possible values are: leaveInPlace, remove.
    createdAt String
    When the rule was created
    id String
    Unique identifier for this announcement rule
    microsoftTeamsChannelIds List<String>
    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
    owningTeamIds List<String>
    IDs of the teams that own this rule
    privateIncidentScope String
    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.
    slackChannelIds List<String>
    IDs of the Slack channels to post announcements into, when the organisation uses Slack
    templateId String
    ID of the announcement template used to render this rule's posts
    updateSharingMode String
    Where incident updates are shared once the incident is announced. Possible values are: none, thread, threadAndChannel.
    updatedAt String
    When the rule was last updated

    Supporting Types

    GetAnnouncementRuleConditionGroup

    Conditions List<GetAnnouncementRuleConditionGroupCondition>
    All conditions in this list must be satisfied for the group to be satisfied
    Conditions []GetAnnouncementRuleConditionGroupCondition
    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<GetAnnouncementRuleConditionGroupCondition>
    All conditions in this list must be satisfied for the group to be satisfied
    conditions GetAnnouncementRuleConditionGroupCondition[]
    All conditions in this list must be satisfied for the group to be satisfied
    conditions Sequence[GetAnnouncementRuleConditionGroupCondition]
    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(object)
    Bindings for the operation parameters
    subject string
    operation String
    paramBindings List<Property Map>
    Bindings for the operation parameters
    subject String

    GetAnnouncementRuleConditionGroupConditionParamBinding

    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)
    arrayValues List<Property Map>
    If array*value is set, this helps render the values
    expressionRef String
    value Property Map
    valueLiteral String
    valueReference String
    values List<String>

    GetAnnouncementRuleConditionGroupConditionParamBindingArrayValue

    Literal string
    If set, this is the literal value of the step parameter
    Reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    Literal string
    If set, this is the literal value of the step parameter
    Reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal string
    If set, this is the literal value of the step parameter
    reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal String
    If set, this is the literal value of the step parameter
    reference String
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal string
    If set, this is the literal value of the step parameter
    reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal str
    If set, this is the literal value of the step parameter
    reference str
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal String
    If set, this is the literal value of the step parameter
    reference String
    If set, this is the reference into the trigger scope that is the value of this parameter

    GetAnnouncementRuleConditionGroupConditionParamBindingValue

    Literal string
    If set, this is the literal value of the step parameter
    Reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    Literal string
    If set, this is the literal value of the step parameter
    Reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal string
    If set, this is the literal value of the step parameter
    reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal String
    If set, this is the literal value of the step parameter
    reference String
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal string
    If set, this is the literal value of the step parameter
    reference string
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal str
    If set, this is the literal value of the step parameter
    reference str
    If set, this is the reference into the trigger scope that is the value of this parameter
    literal String
    If set, this is the literal value of the step parameter
    reference String
    If set, this is the reference into the trigger scope that is the value of this parameter

    Package Details

    Repository
    incident incident-io/pulumi-incident
    License
    MIT
    Notes
    This Pulumi package is based on the incident Terraform Provider.
    incident logo incident.io
    Viewing docs for incident.io v0.4.1
    published on Wednesday, Oct 21, 2026 by incident-io

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial