1. Packages
  2. Sentry
  3. API Docs
  4. SentryRule
Sentry v0.0.8 published on Saturday, Dec 3, 2022 by Pulumiverse

sentry.SentryRule

Explore with Pulumi AI

sentry logo
Sentry v0.0.8 published on Saturday, Dec 3, 2022 by Pulumiverse

    # sentry.SentryRule Resource

    Sentry Rule resource. Note that there’s no public documentation for the values of conditions, filters, and actions. You can either inspect the request payload sent when creating or editing an alert rule on Sentry or inspect Sentry’s rules registry in the source code.

    Example Usage

    using Pulumi;
    using Sentry = Pulumiverse.Sentry;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            // Create a plugin
            var @default = new Sentry.SentryRule("default", new Sentry.SentryRuleArgs
            {
                ActionMatch = "any",
                Actions = 
                {
                    
                    {
                        { "id", "sentry.mail.actions.NotifyEmailAction" },
                        { "name", "Send an email to IssueOwners" },
                        { "targetIdentifier", "" },
                        { "targetType", "IssueOwners" },
                    },
                },
                Conditions = 
                {
                    
                    {
                        { "id", "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition" },
                        { "name", "A new issue is created" },
                    },
                },
                Environment = "production",
                Filters = 
                {
                    
                    {
                        { "id", "sentry.rules.filters.assigned_to.AssignedToFilter" },
                        { "targetType", "Unassigned" },
                    },
                },
                Frequency = 30,
                Organization = "my-organization",
                Project = "web-app",
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-sentry/sdk/go/sentry"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sentry.NewSentryRule(ctx, "default", &sentry.SentryRuleArgs{
    			ActionMatch: pulumi.String("any"),
    			Actions: pulumi.AnyMapArray{
    				pulumi.AnyMap{
    					"id":               pulumi.Any("sentry.mail.actions.NotifyEmailAction"),
    					"name":             pulumi.Any("Send an email to IssueOwners"),
    					"targetIdentifier": pulumi.Any(""),
    					"targetType":       pulumi.Any("IssueOwners"),
    				},
    			},
    			Conditions: pulumi.AnyMapArray{
    				pulumi.AnyMap{
    					"id":   pulumi.Any("sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"),
    					"name": pulumi.Any("A new issue is created"),
    				},
    			},
    			Environment: pulumi.String("production"),
    			Filters: pulumi.AnyMapArray{
    				pulumi.AnyMap{
    					"id":         pulumi.Any("sentry.rules.filters.assigned_to.AssignedToFilter"),
    					"targetType": pulumi.Any("Unassigned"),
    				},
    			},
    			Frequency:    pulumi.Int(30),
    			Organization: pulumi.String("my-organization"),
    			Project:      pulumi.String("web-app"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import java.util.*;
    import java.io.*;
    import java.nio.*;
    import com.pulumi.*;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var default_ = new SentryRule("default", SentryRuleArgs.builder()        
                .actionMatch("any")
                .actions(Map.ofEntries(
                    Map.entry("id", "sentry.mail.actions.NotifyEmailAction"),
                    Map.entry("name", "Send an email to IssueOwners"),
                    Map.entry("targetIdentifier", ""),
                    Map.entry("targetType", "IssueOwners")
                ))
                .conditions(Map.ofEntries(
                    Map.entry("id", "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"),
                    Map.entry("name", "A new issue is created")
                ))
                .environment("production")
                .filters(Map.ofEntries(
                    Map.entry("id", "sentry.rules.filters.assigned_to.AssignedToFilter"),
                    Map.entry("targetType", "Unassigned")
                ))
                .frequency(30)
                .organization("my-organization")
                .project("web-app")
                .build());
    
        }
    }
    
    import pulumi
    import pulumiverse_sentry as sentry
    
    # Create a plugin
    default = sentry.SentryRule("default",
        action_match="any",
        actions=[{
            "id": "sentry.mail.actions.NotifyEmailAction",
            "name": "Send an email to IssueOwners",
            "targetIdentifier": "",
            "targetType": "IssueOwners",
        }],
        conditions=[{
            "id": "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition",
            "name": "A new issue is created",
        }],
        environment="production",
        filters=[{
            "id": "sentry.rules.filters.assigned_to.AssignedToFilter",
            "targetType": "Unassigned",
        }],
        frequency=30,
        organization="my-organization",
        project="web-app")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as sentry from "@pulumi/sentry";
    
    // Create a plugin
    const defaultSentryRule = new sentry.SentryRule("default", {
        actionMatch: "any",
        actions: [{
            id: "sentry.mail.actions.NotifyEmailAction",
            name: "Send an email to IssueOwners",
            targetIdentifier: "",
            targetType: "IssueOwners",
        }],
        conditions: [{
            id: "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition",
            name: "A new issue is created",
        }],
        environment: "production",
        filters: [{
            id: "sentry.rules.filters.assigned_to.AssignedToFilter",
            targetType: "Unassigned",
        }],
        frequency: 30,
        organization: "my-organization",
        project: "web-app",
    });
    
    resources:
      default:
        type: sentry:SentryRule
        properties:
          actionMatch: any
          actions:
            - id: sentry.mail.actions.NotifyEmailAction
              name: Send an email to IssueOwners
              targetIdentifier:
              targetType: IssueOwners
          conditions:
            - id: sentry.rules.conditions.first_seen_event.FirstSeenEventCondition
              name: A new issue is created
          environment: production
          filters:
            - id: sentry.rules.filters.assigned_to.AssignedToFilter
              targetType: Unassigned
          frequency: 30
          organization: my-organization
          project: web-app
    

    Create SentryRule Resource

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

    Constructor syntax

    new SentryRule(name: string, args: SentryRuleArgs, opts?: CustomResourceOptions);
    @overload
    def SentryRule(resource_name: str,
                   args: SentryRuleArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def SentryRule(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   actions: Optional[Sequence[Mapping[str, Any]]] = None,
                   conditions: Optional[Sequence[Mapping[str, Any]]] = None,
                   organization: Optional[str] = None,
                   project: Optional[str] = None,
                   action_match: Optional[str] = None,
                   environment: Optional[str] = None,
                   filter_match: Optional[str] = None,
                   filters: Optional[Sequence[Mapping[str, Any]]] = None,
                   frequency: Optional[int] = None,
                   name: Optional[str] = None)
    func NewSentryRule(ctx *Context, name string, args SentryRuleArgs, opts ...ResourceOption) (*SentryRule, error)
    public SentryRule(string name, SentryRuleArgs args, CustomResourceOptions? opts = null)
    public SentryRule(String name, SentryRuleArgs args)
    public SentryRule(String name, SentryRuleArgs args, CustomResourceOptions options)
    
    type: sentry:SentryRule
    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 SentryRuleArgs
    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 SentryRuleArgs
    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 SentryRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SentryRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SentryRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var sentryRuleResource = new Sentry.SentryRule("sentryRuleResource", new()
    {
        Actions = new[]
        {
            
            {
                { "string", "any" },
            },
        },
        Conditions = new[]
        {
            
            {
                { "string", "any" },
            },
        },
        Organization = "string",
        Project = "string",
        ActionMatch = "string",
        Environment = "string",
        FilterMatch = "string",
        Filters = new[]
        {
            
            {
                { "string", "any" },
            },
        },
        Frequency = 0,
        Name = "string",
    });
    
    example, err := sentry.NewSentryRule(ctx, "sentryRuleResource", &sentry.SentryRuleArgs{
    	Actions: pulumi.MapArray{
    		pulumi.Map{
    			"string": pulumi.Any("any"),
    		},
    	},
    	Conditions: pulumi.MapArray{
    		pulumi.Map{
    			"string": pulumi.Any("any"),
    		},
    	},
    	Organization: pulumi.String("string"),
    	Project:      pulumi.String("string"),
    	ActionMatch:  pulumi.String("string"),
    	Environment:  pulumi.String("string"),
    	FilterMatch:  pulumi.String("string"),
    	Filters: pulumi.MapArray{
    		pulumi.Map{
    			"string": pulumi.Any("any"),
    		},
    	},
    	Frequency: pulumi.Int(0),
    	Name:      pulumi.String("string"),
    })
    
    var sentryRuleResource = new SentryRule("sentryRuleResource", SentryRuleArgs.builder()        
        .actions(Map.of("string", "any"))
        .conditions(Map.of("string", "any"))
        .organization("string")
        .project("string")
        .actionMatch("string")
        .environment("string")
        .filterMatch("string")
        .filters(Map.of("string", "any"))
        .frequency(0)
        .name("string")
        .build());
    
    sentry_rule_resource = sentry.SentryRule("sentryRuleResource",
        actions=[{
            "string": "any",
        }],
        conditions=[{
            "string": "any",
        }],
        organization="string",
        project="string",
        action_match="string",
        environment="string",
        filter_match="string",
        filters=[{
            "string": "any",
        }],
        frequency=0,
        name="string")
    
    const sentryRuleResource = new sentry.SentryRule("sentryRuleResource", {
        actions: [{
            string: "any",
        }],
        conditions: [{
            string: "any",
        }],
        organization: "string",
        project: "string",
        actionMatch: "string",
        environment: "string",
        filterMatch: "string",
        filters: [{
            string: "any",
        }],
        frequency: 0,
        name: "string",
    });
    
    type: sentry:SentryRule
    properties:
        actionMatch: string
        actions:
            - string: any
        conditions:
            - string: any
        environment: string
        filterMatch: string
        filters:
            - string: any
        frequency: 0
        name: string
        organization: string
        project: string
    

    SentryRule Resource Properties

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

    Inputs

    The SentryRule resource accepts the following input properties:

    Actions List<ImmutableDictionary<string, object>>
    List of actions.
    Conditions List<ImmutableDictionary<string, object>>
    List of conditions.
    Organization string
    The slug of the organization the plugin should be enabled for.
    Project string
    The slug of the project the plugin should be enabled for.
    ActionMatch string
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    Environment string
    Environment for these conditions to apply to.
    FilterMatch string
    Filters List<ImmutableDictionary<string, object>>
    List of filters.
    Frequency int
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    Name string
    Name for this alert.
    Actions []map[string]interface{}
    List of actions.
    Conditions []map[string]interface{}
    List of conditions.
    Organization string
    The slug of the organization the plugin should be enabled for.
    Project string
    The slug of the project the plugin should be enabled for.
    ActionMatch string
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    Environment string
    Environment for these conditions to apply to.
    FilterMatch string
    Filters []map[string]interface{}
    List of filters.
    Frequency int
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    Name string
    Name for this alert.
    actions List<Map<String,Object>>
    List of actions.
    conditions List<Map<String,Object>>
    List of conditions.
    organization String
    The slug of the organization the plugin should be enabled for.
    project String
    The slug of the project the plugin should be enabled for.
    actionMatch String
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    environment String
    Environment for these conditions to apply to.
    filterMatch String
    filters List<Map<String,Object>>
    List of filters.
    frequency Integer
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name String
    Name for this alert.
    actions {[key: string]: any}[]
    List of actions.
    conditions {[key: string]: any}[]
    List of conditions.
    organization string
    The slug of the organization the plugin should be enabled for.
    project string
    The slug of the project the plugin should be enabled for.
    actionMatch string
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    environment string
    Environment for these conditions to apply to.
    filterMatch string
    filters {[key: string]: any}[]
    List of filters.
    frequency number
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name string
    Name for this alert.
    actions Sequence[Mapping[str, Any]]
    List of actions.
    conditions Sequence[Mapping[str, Any]]
    List of conditions.
    organization str
    The slug of the organization the plugin should be enabled for.
    project str
    The slug of the project the plugin should be enabled for.
    action_match str
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    environment str
    Environment for these conditions to apply to.
    filter_match str
    filters Sequence[Mapping[str, Any]]
    List of filters.
    frequency int
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name str
    Name for this alert.
    actions List<Map<Any>>
    List of actions.
    conditions List<Map<Any>>
    List of conditions.
    organization String
    The slug of the organization the plugin should be enabled for.
    project String
    The slug of the project the plugin should be enabled for.
    actionMatch String
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    environment String
    Environment for these conditions to apply to.
    filterMatch String
    filters List<Map<Any>>
    List of filters.
    frequency Number
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name String
    Name for this alert.

    Outputs

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

    Get an existing SentryRule 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?: SentryRuleState, opts?: CustomResourceOptions): SentryRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            action_match: Optional[str] = None,
            actions: Optional[Sequence[Mapping[str, Any]]] = None,
            conditions: Optional[Sequence[Mapping[str, Any]]] = None,
            environment: Optional[str] = None,
            filter_match: Optional[str] = None,
            filters: Optional[Sequence[Mapping[str, Any]]] = None,
            frequency: Optional[int] = None,
            name: Optional[str] = None,
            organization: Optional[str] = None,
            project: Optional[str] = None) -> SentryRule
    func GetSentryRule(ctx *Context, name string, id IDInput, state *SentryRuleState, opts ...ResourceOption) (*SentryRule, error)
    public static SentryRule Get(string name, Input<string> id, SentryRuleState? state, CustomResourceOptions? opts = null)
    public static SentryRule get(String name, Output<String> id, SentryRuleState 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:
    ActionMatch string
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    Actions List<ImmutableDictionary<string, object>>
    List of actions.
    Conditions List<ImmutableDictionary<string, object>>
    List of conditions.
    Environment string
    Environment for these conditions to apply to.
    FilterMatch string
    Filters List<ImmutableDictionary<string, object>>
    List of filters.
    Frequency int
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    Name string
    Name for this alert.
    Organization string
    The slug of the organization the plugin should be enabled for.
    Project string
    The slug of the project the plugin should be enabled for.
    ActionMatch string
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    Actions []map[string]interface{}
    List of actions.
    Conditions []map[string]interface{}
    List of conditions.
    Environment string
    Environment for these conditions to apply to.
    FilterMatch string
    Filters []map[string]interface{}
    List of filters.
    Frequency int
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    Name string
    Name for this alert.
    Organization string
    The slug of the organization the plugin should be enabled for.
    Project string
    The slug of the project the plugin should be enabled for.
    actionMatch String
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    actions List<Map<String,Object>>
    List of actions.
    conditions List<Map<String,Object>>
    List of conditions.
    environment String
    Environment for these conditions to apply to.
    filterMatch String
    filters List<Map<String,Object>>
    List of filters.
    frequency Integer
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name String
    Name for this alert.
    organization String
    The slug of the organization the plugin should be enabled for.
    project String
    The slug of the project the plugin should be enabled for.
    actionMatch string
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    actions {[key: string]: any}[]
    List of actions.
    conditions {[key: string]: any}[]
    List of conditions.
    environment string
    Environment for these conditions to apply to.
    filterMatch string
    filters {[key: string]: any}[]
    List of filters.
    frequency number
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name string
    Name for this alert.
    organization string
    The slug of the organization the plugin should be enabled for.
    project string
    The slug of the project the plugin should be enabled for.
    action_match str
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    actions Sequence[Mapping[str, Any]]
    List of actions.
    conditions Sequence[Mapping[str, Any]]
    List of conditions.
    environment str
    Environment for these conditions to apply to.
    filter_match str
    filters Sequence[Mapping[str, Any]]
    List of filters.
    frequency int
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name str
    Name for this alert.
    organization str
    The slug of the organization the plugin should be enabled for.
    project str
    The slug of the project the plugin should be enabled for.
    actionMatch String
    Use all to trigger alerting when all conditions are met, and any when at. least a condition is met. Defaults to any.
    actions List<Map<Any>>
    List of actions.
    conditions List<Map<Any>>
    List of conditions.
    environment String
    Environment for these conditions to apply to.
    filterMatch String
    filters List<Map<Any>>
    List of filters.
    frequency Number
    Perform actions at most once every X minutes for this issue. Defaults to 30.
    name String
    Name for this alert.
    organization String
    The slug of the organization the plugin should be enabled for.
    project String
    The slug of the project the plugin should be enabled for.

    Package Details

    Repository
    sentry pulumiverse/pulumi-sentry
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the sentry Terraform Provider.
    sentry logo
    Sentry v0.0.8 published on Saturday, Dec 3, 2022 by Pulumiverse