zenduty.Alertrules
Explore with Pulumi AI
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 resolved2
- add note , value will be the note summary to add3
- supress alert , value is not required4
- add escalation policy , value should be the unique_id of the escalation policy6
- assign user , value should be the username of the user7
- change urgency , value should be one of the following:0
for low,1
for high8
- change message , value should be the message to change to9
- change summary , value should be the summary to change to10
- change entry_id , value should be the entity to change to11
- assign role to user ,key
should be unique_id of the role , value should be the username of the user12
- add tag, value should be the unique_id of the tag14
- add sla , value should be the unique_id of the sla15
- add team priority , value should be the unique_id of the team priority16
- add task template , value should be the unique_id of the task template17
- add assign incident responder , value should be the unique_id of the responder18
- hash entity_id, value is not required
value
(Required)(string) - The value of the action. (not required for3
)key
(Optional)(string) - The key of the action. (required for11
)
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.
- Integration
Id string - The unique_id of the integration to create the alert rule in.
- Service
Id string - The unique_id of the service to create the alert rule in.
- Team
Id string - The unique_id of the team to create the alert rule in.
- Actions
List<Alertrules
Action> The actions to be performed when the rule matches. (see below for nested schema)
- Alertrules
Id string - The ID of the Alert Rule.
- Rule
Json string
- Description string
- The description of the alert rule.
- Integration
Id string - The unique_id of the integration to create the alert rule in.
- Service
Id string - The unique_id of the service to create the alert rule in.
- Team
Id string - The unique_id of the team to create the alert rule in.
- Actions
[]Alertrules
Action Args The actions to be performed when the rule matches. (see below for nested schema)
- Alertrules
Id string - The ID of the Alert Rule.
- Rule
Json string
- description String
- The description of the alert rule.
- integration
Id String - The unique_id of the integration to create the alert rule in.
- service
Id String - The unique_id of the service to create the alert rule in.
- team
Id String - The unique_id of the team to create the alert rule in.
- actions
List<Alertrules
Action> The actions to be performed when the rule matches. (see below for nested schema)
- alertrules
Id String - The ID of the Alert Rule.
- rule
Json String
- description string
- The description of the alert rule.
- integration
Id string - The unique_id of the integration to create the alert rule in.
- service
Id string - The unique_id of the service to create the alert rule in.
- team
Id string - The unique_id of the team to create the alert rule in.
- actions
Alertrules
Action[] The actions to be performed when the rule matches. (see below for nested schema)
- alertrules
Id string - The ID of the Alert Rule.
- rule
Json 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[Alertrules
Action Args] 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.
- integration
Id String - The unique_id of the integration to create the alert rule in.
- service
Id String - The unique_id of the service to create the alert rule in.
- team
Id 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)
- alertrules
Id String - The ID of the Alert Rule.
- rule
Json 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.
- Actions
List<Alertrules
Action> The actions to be performed when the rule matches. (see below for nested schema)
- Alertrules
Id string - The ID of the Alert Rule.
- Description string
- The description of the alert rule.
- Integration
Id string - The unique_id of the integration to create the alert rule in.
- Rule
Json string - Service
Id string - The unique_id of the service to create the alert rule in.
- Team
Id string - The unique_id of the team to create the alert rule in.
- Actions
[]Alertrules
Action Args The actions to be performed when the rule matches. (see below for nested schema)
- Alertrules
Id string - The ID of the Alert Rule.
- Description string
- The description of the alert rule.
- Integration
Id string - The unique_id of the integration to create the alert rule in.
- Rule
Json string - Service
Id string - The unique_id of the service to create the alert rule in.
- Team
Id string - The unique_id of the team to create the alert rule in.
- actions
List<Alertrules
Action> The actions to be performed when the rule matches. (see below for nested schema)
- alertrules
Id String - The ID of the Alert Rule.
- description String
- The description of the alert rule.
- integration
Id String - The unique_id of the integration to create the alert rule in.
- rule
Json String - service
Id String - The unique_id of the service to create the alert rule in.
- team
Id String - The unique_id of the team to create the alert rule in.
- actions
Alertrules
Action[] The actions to be performed when the rule matches. (see below for nested schema)
- alertrules
Id string - The ID of the Alert Rule.
- description string
- The description of the alert rule.
- integration
Id string - The unique_id of the integration to create the alert rule in.
- rule
Json string - service
Id string - The unique_id of the service to create the alert rule in.
- team
Id string - The unique_id of the team to create the alert rule in.
- actions
Sequence[Alertrules
Action Args] 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)
- alertrules
Id String - The ID of the Alert Rule.
- description String
- The description of the alert rule.
- integration
Id String - The unique_id of the integration to create the alert rule in.
- rule
Json String - service
Id String - The unique_id of the service to create the alert rule in.
- team
Id String - The unique_id of the team to create the alert rule in.
Supporting Types
AlertrulesAction, AlertrulesActionArgs
- Action
Type double - Key string
- Value string
- Action
Type float64 - Key string
- Value string
- action
Type Double - key String
- value String
- action
Type number - key string
- value string
- action_
type float - key str
- value str
- action
Type 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.