1. Packages
  2. Zenduty Provider
  3. API Docs
  4. Alertrules
zenduty 0.2.6 published on Wednesday, Jan 15, 2025 by zenduty

zenduty.Alertrules

Explore with Pulumi AI

zenduty logo
zenduty 0.2.6 published on Wednesday, Jan 15, 2025 by zenduty

    zenduty.Alertrules is a resource to manage alert rules in a integration

    Actions

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    
    • action_type (Required) (Number):

      • 1 - change the alert type , value should be one of the following: 0 for info, 1 for warning, 2 for error, 3 for critical , 4 for acknowledged , 5 for resolved
      • 2 - add note , value will be the note summary to add
      • 3 - supress alert , value is not required
      • 4 - add escalation policy , value should be the unique_id of the escalation policy
      • 6 - assign user , value should be the username of the user
      • 7 - change urgency , value should be one of the following: 0 for low, 1 for high
      • 8 - change message , value should be the message to change to
      • 9 - change summary , value should be the summary to change to
      • 10 - change entry_id , value should be the entity to change to
      • 11 - assign role to user , key should be unique_id of the role , value should be the username of the user
      • 12 - add tag, value should be the unique_id of the tag
      • 14 - add sla , value should be the unique_id of the sla
      • 15 - add team priority , value should be the unique_id of the team priority
      • 16 - add task template , value should be the unique_id of the task template
      • 17 - add assign incident responder , value should be the unique_id of the responder
      • 18 - hash entity_id, value is not required
    • value (Required)(string) - The value of the action. (not required for 3)

    • key (Optional)(string) - The key of the action. (required for 11)

    Create Alertrules Resource

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

    Constructor syntax

    new Alertrules(name: string, args: AlertrulesArgs, opts?: CustomResourceOptions);
    @overload
    def Alertrules(resource_name: str,
                   args: AlertrulesArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Alertrules(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   description: Optional[str] = None,
                   integration_id: Optional[str] = None,
                   service_id: Optional[str] = None,
                   team_id: Optional[str] = None,
                   actions: Optional[Sequence[AlertrulesActionArgs]] = None,
                   alertrules_id: Optional[str] = None,
                   rule_json: Optional[str] = None)
    func NewAlertrules(ctx *Context, name string, args AlertrulesArgs, opts ...ResourceOption) (*Alertrules, error)
    public Alertrules(string name, AlertrulesArgs args, CustomResourceOptions? opts = null)
    public Alertrules(String name, AlertrulesArgs args)
    public Alertrules(String name, AlertrulesArgs args, CustomResourceOptions options)
    
    type: zenduty:Alertrules
    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 AlertrulesArgs
    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 AlertrulesArgs
    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 AlertrulesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertrulesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertrulesArgs
    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 alertrulesResource = new Zenduty.Alertrules("alertrulesResource", new()
    {
        Description = "string",
        IntegrationId = "string",
        ServiceId = "string",
        TeamId = "string",
        Actions = new[]
        {
            new Zenduty.Inputs.AlertrulesActionArgs
            {
                ActionType = 0,
                Key = "string",
                Value = "string",
            },
        },
        AlertrulesId = "string",
        RuleJson = "string",
    });
    
    example, err := zenduty.NewAlertrules(ctx, "alertrulesResource", &zenduty.AlertrulesArgs{
    Description: pulumi.String("string"),
    IntegrationId: pulumi.String("string"),
    ServiceId: pulumi.String("string"),
    TeamId: pulumi.String("string"),
    Actions: .AlertrulesActionArray{
    &.AlertrulesActionArgs{
    ActionType: pulumi.Float64(0),
    Key: pulumi.String("string"),
    Value: pulumi.String("string"),
    },
    },
    AlertrulesId: pulumi.String("string"),
    RuleJson: pulumi.String("string"),
    })
    
    var alertrulesResource = new Alertrules("alertrulesResource", AlertrulesArgs.builder()
        .description("string")
        .integrationId("string")
        .serviceId("string")
        .teamId("string")
        .actions(AlertrulesActionArgs.builder()
            .actionType(0)
            .key("string")
            .value("string")
            .build())
        .alertrulesId("string")
        .ruleJson("string")
        .build());
    
    alertrules_resource = zenduty.Alertrules("alertrulesResource",
        description="string",
        integration_id="string",
        service_id="string",
        team_id="string",
        actions=[{
            "action_type": 0,
            "key": "string",
            "value": "string",
        }],
        alertrules_id="string",
        rule_json="string")
    
    const alertrulesResource = new zenduty.Alertrules("alertrulesResource", {
        description: "string",
        integrationId: "string",
        serviceId: "string",
        teamId: "string",
        actions: [{
            actionType: 0,
            key: "string",
            value: "string",
        }],
        alertrulesId: "string",
        ruleJson: "string",
    });
    
    type: zenduty:Alertrules
    properties:
        actions:
            - actionType: 0
              key: string
              value: string
        alertrulesId: string
        description: string
        integrationId: string
        ruleJson: string
        serviceId: string
        teamId: string
    

    Alertrules 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 Alertrules resource accepts the following input properties:

    Description string
    The description of the alert rule.
    IntegrationId string
    The unique_id of the integration to create the alert rule in.
    ServiceId string
    The unique_id of the service to create the alert rule in.
    TeamId string
    The unique_id of the team to create the alert rule in.
    Actions List<AlertrulesAction>

    The actions to be performed when the rule matches. (see below for nested schema)

    AlertrulesId string
    The ID of the Alert Rule.
    RuleJson string
    Description string
    The description of the alert rule.
    IntegrationId string
    The unique_id of the integration to create the alert rule in.
    ServiceId string
    The unique_id of the service to create the alert rule in.
    TeamId string
    The unique_id of the team to create the alert rule in.
    Actions []AlertrulesActionArgs

    The actions to be performed when the rule matches. (see below for nested schema)

    AlertrulesId string
    The ID of the Alert Rule.
    RuleJson string
    description String
    The description of the alert rule.
    integrationId String
    The unique_id of the integration to create the alert rule in.
    serviceId String
    The unique_id of the service to create the alert rule in.
    teamId String
    The unique_id of the team to create the alert rule in.
    actions List<AlertrulesAction>

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrulesId String
    The ID of the Alert Rule.
    ruleJson String
    description string
    The description of the alert rule.
    integrationId string
    The unique_id of the integration to create the alert rule in.
    serviceId string
    The unique_id of the service to create the alert rule in.
    teamId string
    The unique_id of the team to create the alert rule in.
    actions AlertrulesAction[]

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrulesId string
    The ID of the Alert Rule.
    ruleJson string
    description str
    The description of the alert rule.
    integration_id str
    The unique_id of the integration to create the alert rule in.
    service_id str
    The unique_id of the service to create the alert rule in.
    team_id str
    The unique_id of the team to create the alert rule in.
    actions Sequence[AlertrulesActionArgs]

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrules_id str
    The ID of the Alert Rule.
    rule_json str
    description String
    The description of the alert rule.
    integrationId String
    The unique_id of the integration to create the alert rule in.
    serviceId String
    The unique_id of the service to create the alert rule in.
    teamId String
    The unique_id of the team to create the alert rule in.
    actions List<Property Map>

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrulesId String
    The ID of the Alert Rule.
    ruleJson String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Alertrules 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 Alertrules Resource

    Get an existing Alertrules 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?: AlertrulesState, opts?: CustomResourceOptions): Alertrules
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            actions: Optional[Sequence[AlertrulesActionArgs]] = None,
            alertrules_id: Optional[str] = None,
            description: Optional[str] = None,
            integration_id: Optional[str] = None,
            rule_json: Optional[str] = None,
            service_id: Optional[str] = None,
            team_id: Optional[str] = None) -> Alertrules
    func GetAlertrules(ctx *Context, name string, id IDInput, state *AlertrulesState, opts ...ResourceOption) (*Alertrules, error)
    public static Alertrules Get(string name, Input<string> id, AlertrulesState? state, CustomResourceOptions? opts = null)
    public static Alertrules get(String name, Output<String> id, AlertrulesState state, CustomResourceOptions options)
    resources:  _:    type: zenduty:Alertrules    get:      id: ${id}
    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:
    Actions List<AlertrulesAction>

    The actions to be performed when the rule matches. (see below for nested schema)

    AlertrulesId string
    The ID of the Alert Rule.
    Description string
    The description of the alert rule.
    IntegrationId string
    The unique_id of the integration to create the alert rule in.
    RuleJson string
    ServiceId string
    The unique_id of the service to create the alert rule in.
    TeamId string
    The unique_id of the team to create the alert rule in.
    Actions []AlertrulesActionArgs

    The actions to be performed when the rule matches. (see below for nested schema)

    AlertrulesId string
    The ID of the Alert Rule.
    Description string
    The description of the alert rule.
    IntegrationId string
    The unique_id of the integration to create the alert rule in.
    RuleJson string
    ServiceId string
    The unique_id of the service to create the alert rule in.
    TeamId string
    The unique_id of the team to create the alert rule in.
    actions List<AlertrulesAction>

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrulesId String
    The ID of the Alert Rule.
    description String
    The description of the alert rule.
    integrationId String
    The unique_id of the integration to create the alert rule in.
    ruleJson String
    serviceId String
    The unique_id of the service to create the alert rule in.
    teamId String
    The unique_id of the team to create the alert rule in.
    actions AlertrulesAction[]

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrulesId string
    The ID of the Alert Rule.
    description string
    The description of the alert rule.
    integrationId string
    The unique_id of the integration to create the alert rule in.
    ruleJson string
    serviceId string
    The unique_id of the service to create the alert rule in.
    teamId string
    The unique_id of the team to create the alert rule in.
    actions Sequence[AlertrulesActionArgs]

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrules_id str
    The ID of the Alert Rule.
    description str
    The description of the alert rule.
    integration_id str
    The unique_id of the integration to create the alert rule in.
    rule_json str
    service_id str
    The unique_id of the service to create the alert rule in.
    team_id str
    The unique_id of the team to create the alert rule in.
    actions List<Property Map>

    The actions to be performed when the rule matches. (see below for nested schema)

    alertrulesId String
    The ID of the Alert Rule.
    description String
    The description of the alert rule.
    integrationId String
    The unique_id of the integration to create the alert rule in.
    ruleJson String
    serviceId String
    The unique_id of the service to create the alert rule in.
    teamId String
    The unique_id of the team to create the alert rule in.

    Supporting Types

    AlertrulesAction, AlertrulesActionArgs

    ActionType double
    Key string
    Value string
    ActionType float64
    Key string
    Value string
    actionType Double
    key String
    value String
    actionType number
    key string
    value string
    action_type float
    key str
    value str
    actionType Number
    key String
    value String

    Import

    Integrations can be imported using the team_id(ie. unique_id of the team), service_id(ie. unique_id of the service),integration_id(ie. unique_id of the integration) and alertrule_id(ie. unique_id of the alert rule).

    hcl

    resource “zenduty_alertrules” “rule1” {

    }

    $ pulumi import zenduty:index/alertrules:Alertrules rule1 team_id/service_id/integration_id/alertrule_id`
    

    $ terraform state show zenduty_alertrules.rule1

    * copy the output data and paste inside zenduty_alertrules.rule1 resource block and remove the id attribute

    $ pulumi preview to verify the import

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    zenduty zenduty/terraform-provider-zenduty
    License
    Notes
    This Pulumi package is based on the zenduty Terraform Provider.
    zenduty logo
    zenduty 0.2.6 published on Wednesday, Jan 15, 2025 by zenduty