1. Packages
  2. Pagerduty Provider
  3. API Docs
  4. AlertGroupingSetting
PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi

pagerduty.AlertGroupingSetting

Explore with Pulumi AI

pagerduty logo
PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi

    An alert grouping setting stores and centralize the configuration used during grouping of the alerts.

    Migration from alert_grouping_parameters

    To migrate from using the field alert_grouping_parameters of a service to a pagerduty.AlertGroupingSetting resource, you can cut-and-paste the contents of an alert_grouping_parameters field from a pagerduty.Service resource into the new resource, but you also need to add at least one value in the field services to create the alert grouping setting with a service associated to it.

    If you are using timeout = 0 or time_window = 0 in order to use the values recommended by PagerDuty you also need to set its value to null or delete it, since a value of 0 is no longer accepted.

    Since the alert_grouping_parameters field creates an Alert Grouping Setting behind the scenes, it is necessary to import them if you want to keep your configuration the same as it is right now.

    Example:

    Before:

    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const default = pagerduty.getEscalationPolicy({
        name: "Default",
    });
    const foo = new pagerduty.Service("foo", {
        name: "Foo",
        escalationPolicy: _default.then(_default => _default.id),
        alertGroupingParameters: {
            type: "time",
            config: {
                timeout: 0,
            },
        },
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    default = pagerduty.get_escalation_policy(name="Default")
    foo = pagerduty.Service("foo",
        name="Foo",
        escalation_policy=default.id,
        alert_grouping_parameters={
            "type": "time",
            "config": {
                "timeout": 0,
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := pagerduty.LookupEscalationPolicy(ctx, &pagerduty.LookupEscalationPolicyArgs{
    			Name: "Default",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewService(ctx, "foo", &pagerduty.ServiceArgs{
    			Name:             pulumi.String("Foo"),
    			EscalationPolicy: pulumi.String(_default.Id),
    			AlertGroupingParameters: &pagerduty.ServiceAlertGroupingParametersArgs{
    				Type: pulumi.String("time"),
    				Config: &pagerduty.ServiceAlertGroupingParametersConfigArgs{
    					Timeout: pulumi.Int(0),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Pagerduty = Pulumi.Pagerduty;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = Pagerduty.GetEscalationPolicy.Invoke(new()
        {
            Name = "Default",
        });
    
        var foo = new Pagerduty.Service("foo", new()
        {
            Name = "Foo",
            EscalationPolicy = @default.Apply(@default => @default.Apply(getEscalationPolicyResult => getEscalationPolicyResult.Id)),
            AlertGroupingParameters = new Pagerduty.Inputs.ServiceAlertGroupingParametersArgs
            {
                Type = "time",
                Config = new Pagerduty.Inputs.ServiceAlertGroupingParametersConfigArgs
                {
                    Timeout = 0,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.pagerduty.PagerdutyFunctions;
    import com.pulumi.pagerduty.inputs.GetEscalationPolicyArgs;
    import com.pulumi.pagerduty.Service;
    import com.pulumi.pagerduty.ServiceArgs;
    import com.pulumi.pagerduty.inputs.ServiceAlertGroupingParametersArgs;
    import com.pulumi.pagerduty.inputs.ServiceAlertGroupingParametersConfigArgs;
    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 default = PagerdutyFunctions.getEscalationPolicy(GetEscalationPolicyArgs.builder()
                .name("Default")
                .build());
    
            var foo = new Service("foo", ServiceArgs.builder()
                .name("Foo")
                .escalationPolicy(default_.id())
                .alertGroupingParameters(ServiceAlertGroupingParametersArgs.builder()
                    .type("time")
                    .config(ServiceAlertGroupingParametersConfigArgs.builder()
                        .timeout(0)
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      foo:
        type: pagerduty:Service
        properties:
          name: Foo
          escalationPolicy: ${default.id}
          alertGroupingParameters:
            type: time
            config:
              timeout: 0
    variables:
      default:
        fn::invoke:
          Function: pagerduty:getEscalationPolicy
          Arguments:
            name: Default
    

    After:

    Import

    Alert grouping settings can be imported using its id, e.g.

    $ pulumi import pagerduty:index/alertGroupingSetting:AlertGroupingSetting example P3DH5M6
    

    Create AlertGroupingSetting Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AlertGroupingSetting(name: string, args: AlertGroupingSettingArgs, opts?: CustomResourceOptions);
    @overload
    def AlertGroupingSetting(resource_name: str,
                             args: AlertGroupingSettingArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertGroupingSetting(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             services: Optional[Sequence[str]] = None,
                             type: Optional[str] = None,
                             config: Optional[AlertGroupingSettingConfigArgs] = None,
                             description: Optional[str] = None,
                             name: Optional[str] = None)
    func NewAlertGroupingSetting(ctx *Context, name string, args AlertGroupingSettingArgs, opts ...ResourceOption) (*AlertGroupingSetting, error)
    public AlertGroupingSetting(string name, AlertGroupingSettingArgs args, CustomResourceOptions? opts = null)
    public AlertGroupingSetting(String name, AlertGroupingSettingArgs args)
    public AlertGroupingSetting(String name, AlertGroupingSettingArgs args, CustomResourceOptions options)
    
    type: pagerduty:AlertGroupingSetting
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AlertGroupingSettingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AlertGroupingSettingArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AlertGroupingSettingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertGroupingSettingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertGroupingSettingArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var alertGroupingSettingResource = new Pagerduty.AlertGroupingSetting("alertGroupingSettingResource", new()
    {
        Services = new[]
        {
            "string",
        },
        Type = "string",
        Config = new Pagerduty.Inputs.AlertGroupingSettingConfigArgs
        {
            Aggregate = "string",
            Fields = new[]
            {
                "string",
            },
            TimeWindow = 0,
            Timeout = 0,
        },
        Description = "string",
        Name = "string",
    });
    
    example, err := pagerduty.NewAlertGroupingSetting(ctx, "alertGroupingSettingResource", &pagerduty.AlertGroupingSettingArgs{
    	Services: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Type: pulumi.String("string"),
    	Config: &pagerduty.AlertGroupingSettingConfigArgs{
    		Aggregate: pulumi.String("string"),
    		Fields: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		TimeWindow: pulumi.Int(0),
    		Timeout:    pulumi.Int(0),
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var alertGroupingSettingResource = new AlertGroupingSetting("alertGroupingSettingResource", AlertGroupingSettingArgs.builder()
        .services("string")
        .type("string")
        .config(AlertGroupingSettingConfigArgs.builder()
            .aggregate("string")
            .fields("string")
            .timeWindow(0)
            .timeout(0)
            .build())
        .description("string")
        .name("string")
        .build());
    
    alert_grouping_setting_resource = pagerduty.AlertGroupingSetting("alertGroupingSettingResource",
        services=["string"],
        type="string",
        config={
            "aggregate": "string",
            "fields": ["string"],
            "time_window": 0,
            "timeout": 0,
        },
        description="string",
        name="string")
    
    const alertGroupingSettingResource = new pagerduty.AlertGroupingSetting("alertGroupingSettingResource", {
        services: ["string"],
        type: "string",
        config: {
            aggregate: "string",
            fields: ["string"],
            timeWindow: 0,
            timeout: 0,
        },
        description: "string",
        name: "string",
    });
    
    type: pagerduty:AlertGroupingSetting
    properties:
        config:
            aggregate: string
            fields:
                - string
            timeWindow: 0
            timeout: 0
        description: string
        name: string
        services:
            - string
        type: string
    

    AlertGroupingSetting Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AlertGroupingSetting resource accepts the following input properties:

    Services List<string>
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    Type string
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    Config AlertGroupingSettingConfig
    The set of values used for configuration.
    Description string
    A human-friendly text to describe and identify this alert grouping setting.
    Name string
    The name for the alert groupig settings.
    Services []string
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    Type string
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    Config AlertGroupingSettingConfigArgs
    The set of values used for configuration.
    Description string
    A human-friendly text to describe and identify this alert grouping setting.
    Name string
    The name for the alert groupig settings.
    services List<String>
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type String
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config AlertGroupingSettingConfig
    The set of values used for configuration.
    description String
    A human-friendly text to describe and identify this alert grouping setting.
    name String
    The name for the alert groupig settings.
    services string[]
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type string
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config AlertGroupingSettingConfig
    The set of values used for configuration.
    description string
    A human-friendly text to describe and identify this alert grouping setting.
    name string
    The name for the alert groupig settings.
    services Sequence[str]
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type str
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config AlertGroupingSettingConfigArgs
    The set of values used for configuration.
    description str
    A human-friendly text to describe and identify this alert grouping setting.
    name str
    The name for the alert groupig settings.
    services List<String>
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type String
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config Property Map
    The set of values used for configuration.
    description String
    A human-friendly text to describe and identify this alert grouping setting.
    name String
    The name for the alert groupig settings.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AlertGroupingSetting resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AlertGroupingSetting Resource

    Get an existing AlertGroupingSetting resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AlertGroupingSettingState, opts?: CustomResourceOptions): AlertGroupingSetting
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            config: Optional[AlertGroupingSettingConfigArgs] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            services: Optional[Sequence[str]] = None,
            type: Optional[str] = None) -> AlertGroupingSetting
    func GetAlertGroupingSetting(ctx *Context, name string, id IDInput, state *AlertGroupingSettingState, opts ...ResourceOption) (*AlertGroupingSetting, error)
    public static AlertGroupingSetting Get(string name, Input<string> id, AlertGroupingSettingState? state, CustomResourceOptions? opts = null)
    public static AlertGroupingSetting get(String name, Output<String> id, AlertGroupingSettingState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Config AlertGroupingSettingConfig
    The set of values used for configuration.
    Description string
    A human-friendly text to describe and identify this alert grouping setting.
    Name string
    The name for the alert groupig settings.
    Services List<string>
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    Type string
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    Config AlertGroupingSettingConfigArgs
    The set of values used for configuration.
    Description string
    A human-friendly text to describe and identify this alert grouping setting.
    Name string
    The name for the alert groupig settings.
    Services []string
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    Type string
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config AlertGroupingSettingConfig
    The set of values used for configuration.
    description String
    A human-friendly text to describe and identify this alert grouping setting.
    name String
    The name for the alert groupig settings.
    services List<String>
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type String
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config AlertGroupingSettingConfig
    The set of values used for configuration.
    description string
    A human-friendly text to describe and identify this alert grouping setting.
    name string
    The name for the alert groupig settings.
    services string[]
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type string
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config AlertGroupingSettingConfigArgs
    The set of values used for configuration.
    description str
    A human-friendly text to describe and identify this alert grouping setting.
    name str
    The name for the alert groupig settings.
    services Sequence[str]
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type str
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.
    config Property Map
    The set of values used for configuration.
    description String
    A human-friendly text to describe and identify this alert grouping setting.
    name String
    The name for the alert groupig settings.
    services List<String>
    [Updating can cause a resource replacement] The list IDs of services associated to this setting.
    type String
    The type of alert grouping; one of intelligent, time, content_based or content_based_intelligent.

    Supporting Types

    AlertGroupingSettingConfig, AlertGroupingSettingConfigArgs

    Aggregate string
    One of any or all. This setting is only required and applies when type is set to content_based or content_based_intelligent. Group alerts based on one or all of fields value(s).
    Fields List<string>
    Alerts will be grouped together if the content of these fields match. This setting is only required and applies when type is set to content_based or content_based_intelligent.
    TimeWindow int
    The maximum amount of time allowed between Alerts. This setting applies only when type is set to intelligent, content_based, content_based_intelligent. Value must be between 300 and 3600 or exactly 86400 (86400 is supported only for content_based alert grouping). Any Alerts arriving greater than time_window seconds apart will not be grouped together. This is a rolling time window and is counted from the most recently grouped alert. The window is extended every time a new alert is added to the group, up to 24 hours. To use the recommended time window leave this value unset or set it to null.
    Timeout int
    The duration in minutes within which to automatically group incoming alerts. This setting is only required and applies when type is set to time. To continue grouping alerts until the incident is resolved leave this value unset or set it to null.
    Aggregate string
    One of any or all. This setting is only required and applies when type is set to content_based or content_based_intelligent. Group alerts based on one or all of fields value(s).
    Fields []string
    Alerts will be grouped together if the content of these fields match. This setting is only required and applies when type is set to content_based or content_based_intelligent.
    TimeWindow int
    The maximum amount of time allowed between Alerts. This setting applies only when type is set to intelligent, content_based, content_based_intelligent. Value must be between 300 and 3600 or exactly 86400 (86400 is supported only for content_based alert grouping). Any Alerts arriving greater than time_window seconds apart will not be grouped together. This is a rolling time window and is counted from the most recently grouped alert. The window is extended every time a new alert is added to the group, up to 24 hours. To use the recommended time window leave this value unset or set it to null.
    Timeout int
    The duration in minutes within which to automatically group incoming alerts. This setting is only required and applies when type is set to time. To continue grouping alerts until the incident is resolved leave this value unset or set it to null.
    aggregate String
    One of any or all. This setting is only required and applies when type is set to content_based or content_based_intelligent. Group alerts based on one or all of fields value(s).
    fields List<String>
    Alerts will be grouped together if the content of these fields match. This setting is only required and applies when type is set to content_based or content_based_intelligent.
    timeWindow Integer
    The maximum amount of time allowed between Alerts. This setting applies only when type is set to intelligent, content_based, content_based_intelligent. Value must be between 300 and 3600 or exactly 86400 (86400 is supported only for content_based alert grouping). Any Alerts arriving greater than time_window seconds apart will not be grouped together. This is a rolling time window and is counted from the most recently grouped alert. The window is extended every time a new alert is added to the group, up to 24 hours. To use the recommended time window leave this value unset or set it to null.
    timeout Integer
    The duration in minutes within which to automatically group incoming alerts. This setting is only required and applies when type is set to time. To continue grouping alerts until the incident is resolved leave this value unset or set it to null.
    aggregate string
    One of any or all. This setting is only required and applies when type is set to content_based or content_based_intelligent. Group alerts based on one or all of fields value(s).
    fields string[]
    Alerts will be grouped together if the content of these fields match. This setting is only required and applies when type is set to content_based or content_based_intelligent.
    timeWindow number
    The maximum amount of time allowed between Alerts. This setting applies only when type is set to intelligent, content_based, content_based_intelligent. Value must be between 300 and 3600 or exactly 86400 (86400 is supported only for content_based alert grouping). Any Alerts arriving greater than time_window seconds apart will not be grouped together. This is a rolling time window and is counted from the most recently grouped alert. The window is extended every time a new alert is added to the group, up to 24 hours. To use the recommended time window leave this value unset or set it to null.
    timeout number
    The duration in minutes within which to automatically group incoming alerts. This setting is only required and applies when type is set to time. To continue grouping alerts until the incident is resolved leave this value unset or set it to null.
    aggregate str
    One of any or all. This setting is only required and applies when type is set to content_based or content_based_intelligent. Group alerts based on one or all of fields value(s).
    fields Sequence[str]
    Alerts will be grouped together if the content of these fields match. This setting is only required and applies when type is set to content_based or content_based_intelligent.
    time_window int
    The maximum amount of time allowed between Alerts. This setting applies only when type is set to intelligent, content_based, content_based_intelligent. Value must be between 300 and 3600 or exactly 86400 (86400 is supported only for content_based alert grouping). Any Alerts arriving greater than time_window seconds apart will not be grouped together. This is a rolling time window and is counted from the most recently grouped alert. The window is extended every time a new alert is added to the group, up to 24 hours. To use the recommended time window leave this value unset or set it to null.
    timeout int
    The duration in minutes within which to automatically group incoming alerts. This setting is only required and applies when type is set to time. To continue grouping alerts until the incident is resolved leave this value unset or set it to null.
    aggregate String
    One of any or all. This setting is only required and applies when type is set to content_based or content_based_intelligent. Group alerts based on one or all of fields value(s).
    fields List<String>
    Alerts will be grouped together if the content of these fields match. This setting is only required and applies when type is set to content_based or content_based_intelligent.
    timeWindow Number
    The maximum amount of time allowed between Alerts. This setting applies only when type is set to intelligent, content_based, content_based_intelligent. Value must be between 300 and 3600 or exactly 86400 (86400 is supported only for content_based alert grouping). Any Alerts arriving greater than time_window seconds apart will not be grouped together. This is a rolling time window and is counted from the most recently grouped alert. The window is extended every time a new alert is added to the group, up to 24 hours. To use the recommended time window leave this value unset or set it to null.
    timeout Number
    The duration in minutes within which to automatically group incoming alerts. This setting is only required and applies when type is set to time. To continue grouping alerts until the incident is resolved leave this value unset or set it to null.

    Package Details

    Repository
    PagerDuty pulumi/pulumi-pagerduty
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the pagerduty Terraform Provider.
    pagerduty logo
    PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi