1. Packages
  2. Sentry
  3. API Docs
  4. getSentryIssueAlert
Sentry v0.0.9 published on Friday, Nov 15, 2024 by Pulumiverse

sentry.getSentryIssueAlert

Explore with Pulumi AI

Sentry v0.0.9 published on Friday, Nov 15, 2024 by Pulumiverse

Sentry Issue Alert data source. As the object structure of conditions, filters, and actions are undocumented, a tip is to set up an Issue Alert via the Web UI, and use this data source to copy its object structure to your resources.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as sentry from "@pulumi/sentry";
import * as sentry from "@pulumiverse/sentry";

// Retrieve an Issue Alert
// URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
const original = sentry.getSentryIssueAlert({
    organization: "my-organization",
    project: "my-project",
    internalId: "42",
});
// Create a copy of an Issue Alert
const copy = new sentry.SentryIssueAlert("copy", {
    organization: original.then(original => original.organization),
    project: original.then(original => original.project),
    name: original.then(original => `${original.name}-copy`),
    actionMatch: original.then(original => original.actionMatch),
    filterMatch: original.then(original => original.filterMatch),
    frequency: original.then(original => original.frequency),
    conditions: original.then(original => original.conditions),
    filters: original.then(original => original.filters),
    actions: original.then(original => original.actions),
});
Copy
import pulumi
import pulumi_sentry as sentry
import pulumiverse_sentry as sentry

# Retrieve an Issue Alert
# URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
original = sentry.get_sentry_issue_alert(organization="my-organization",
    project="my-project",
    internal_id="42")
# Create a copy of an Issue Alert
copy = sentry.SentryIssueAlert("copy",
    organization=original.organization,
    project=original.project,
    name=f"{original.name}-copy",
    action_match=original.action_match,
    filter_match=original.filter_match,
    frequency=original.frequency,
    conditions=original.conditions,
    filters=original.filters,
    actions=original.actions)
Copy
package main

import (
	"fmt"

	"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 {
		// Retrieve an Issue Alert
		// URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
		original, err := sentry.LookupSentryIssueAlert(ctx, &sentry.LookupSentryIssueAlertArgs{
			Organization: "my-organization",
			Project:      "my-project",
			InternalId:   "42",
		}, nil)
		if err != nil {
			return err
		}
		// Create a copy of an Issue Alert
		_, err = sentry.NewSentryIssueAlert(ctx, "copy", &sentry.SentryIssueAlertArgs{
			Organization: pulumi.String(original.Organization),
			Project:      pulumi.String(original.Project),
			Name:         pulumi.Sprintf("%v-copy", original.Name),
			ActionMatch:  pulumi.String(original.ActionMatch),
			FilterMatch:  pulumi.String(original.FilterMatch),
			Frequency:    pulumi.Int(original.Frequency),
			Conditions:   interface{}(original.Conditions),
			Filters:      interface{}(original.Filters),
			Actions:      interface{}(original.Actions),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sentry = Pulumi.Sentry;
using Sentry = Pulumiverse.Sentry;

return await Deployment.RunAsync(() => 
{
    // Retrieve an Issue Alert
    // URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
    var original = Sentry.GetSentryIssueAlert.Invoke(new()
    {
        Organization = "my-organization",
        Project = "my-project",
        InternalId = "42",
    });

    // Create a copy of an Issue Alert
    var copy = new Sentry.SentryIssueAlert("copy", new()
    {
        Organization = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.Organization),
        Project = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.Project),
        Name = $"{original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.Name)}-copy",
        ActionMatch = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.ActionMatch),
        FilterMatch = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.FilterMatch),
        Frequency = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.Frequency),
        Conditions = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.Conditions),
        Filters = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.Filters),
        Actions = original.Apply(getSentryIssueAlertResult => getSentryIssueAlertResult.Actions),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sentry.SentryFunctions;
import com.pulumi.sentry.inputs.GetSentryIssueAlertArgs;
import com.pulumi.sentry.SentryIssueAlert;
import com.pulumi.sentry.SentryIssueAlertArgs;
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) {
        // Retrieve an Issue Alert
        // URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
        final var original = SentryFunctions.getSentryIssueAlert(GetSentryIssueAlertArgs.builder()
            .organization("my-organization")
            .project("my-project")
            .internalId("42")
            .build());

        // Create a copy of an Issue Alert
        var copy = new SentryIssueAlert("copy", SentryIssueAlertArgs.builder()
            .organization(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.organization()))
            .project(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.project()))
            .name(String.format("%s-copy", original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.name())))
            .actionMatch(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.actionMatch()))
            .filterMatch(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.filterMatch()))
            .frequency(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.frequency()))
            .conditions(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.conditions()))
            .filters(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.filters()))
            .actions(original.applyValue(getSentryIssueAlertResult -> getSentryIssueAlertResult.actions()))
            .build());

    }
}
Copy
resources:
  # Create a copy of an Issue Alert
  copy:
    type: sentry:SentryIssueAlert
    properties:
      organization: ${original.organization}
      project: ${original.project}
      name: ${original.name}-copy
      actionMatch: ${original.actionMatch}
      filterMatch: ${original.filterMatch}
      frequency: ${original.frequency}
      conditions: ${original.conditions}
      filters: ${original.filters}
      actions: ${original.actions}
variables:
  # Retrieve an Issue Alert
  # URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
  original:
    fn::invoke:
      Function: sentry:getSentryIssueAlert
      Arguments:
        organization: my-organization
        project: my-project
        internalId: '42'
Copy

Using getSentryIssueAlert

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 getSentryIssueAlert(args: GetSentryIssueAlertArgs, opts?: InvokeOptions): Promise<GetSentryIssueAlertResult>
function getSentryIssueAlertOutput(args: GetSentryIssueAlertOutputArgs, opts?: InvokeOptions): Output<GetSentryIssueAlertResult>
Copy
def get_sentry_issue_alert(internal_id: Optional[str] = None,
                           organization: Optional[str] = None,
                           project: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetSentryIssueAlertResult
def get_sentry_issue_alert_output(internal_id: Optional[pulumi.Input[str]] = None,
                           organization: Optional[pulumi.Input[str]] = None,
                           project: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetSentryIssueAlertResult]
Copy
func LookupSentryIssueAlert(ctx *Context, args *LookupSentryIssueAlertArgs, opts ...InvokeOption) (*LookupSentryIssueAlertResult, error)
func LookupSentryIssueAlertOutput(ctx *Context, args *LookupSentryIssueAlertOutputArgs, opts ...InvokeOption) LookupSentryIssueAlertResultOutput
Copy

> Note: This function is named LookupSentryIssueAlert in the Go SDK.

public static class GetSentryIssueAlert 
{
    public static Task<GetSentryIssueAlertResult> InvokeAsync(GetSentryIssueAlertArgs args, InvokeOptions? opts = null)
    public static Output<GetSentryIssueAlertResult> Invoke(GetSentryIssueAlertInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSentryIssueAlertResult> getSentryIssueAlert(GetSentryIssueAlertArgs args, InvokeOptions options)
public static Output<GetSentryIssueAlertResult> getSentryIssueAlert(GetSentryIssueAlertArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: sentry:index/getSentryIssueAlert:getSentryIssueAlert
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

InternalId This property is required. string
The internal ID for this issue alert.
Organization This property is required. string
The slug of the organization the issue alert belongs to.
Project This property is required. string
The slug of the project the issue alert belongs to.
InternalId This property is required. string
The internal ID for this issue alert.
Organization This property is required. string
The slug of the organization the issue alert belongs to.
Project This property is required. string
The slug of the project the issue alert belongs to.
internalId This property is required. String
The internal ID for this issue alert.
organization This property is required. String
The slug of the organization the issue alert belongs to.
project This property is required. String
The slug of the project the issue alert belongs to.
internalId This property is required. string
The internal ID for this issue alert.
organization This property is required. string
The slug of the organization the issue alert belongs to.
project This property is required. string
The slug of the project the issue alert belongs to.
internal_id This property is required. str
The internal ID for this issue alert.
organization This property is required. str
The slug of the organization the issue alert belongs to.
project This property is required. str
The slug of the project the issue alert belongs to.
internalId This property is required. String
The internal ID for this issue alert.
organization This property is required. String
The slug of the organization the issue alert belongs to.
project This property is required. String
The slug of the project the issue alert belongs to.

getSentryIssueAlert Result

The following output properties are available:

ActionMatch string
Trigger actions when an event is captured by Sentry and any or all of the specified conditions happen.
Actions List<ImmutableDictionary<string, string>>
List of actions.
Conditions List<ImmutableDictionary<string, string>>
List of conditions.
Environment string
Perform issue alert in a specific environment.
FilterMatch string
Trigger actions if all, any, or none of the specified filters match.
Filters List<ImmutableDictionary<string, string>>
List of filters.
Frequency int
Perform actions at most once every X minutes for this issue. Defaults to 30.
Id string
The provider-assigned unique ID for this managed resource.
InternalId string
The internal ID for this issue alert.
Name string
The issue alert name.
Organization string
The slug of the organization the issue alert belongs to.
Project string
The slug of the project the issue alert belongs to.
ActionMatch string
Trigger actions when an event is captured by Sentry and any or all of the specified conditions happen.
Actions []map[string]string
List of actions.
Conditions []map[string]string
List of conditions.
Environment string
Perform issue alert in a specific environment.
FilterMatch string
Trigger actions if all, any, or none of the specified filters match.
Filters []map[string]string
List of filters.
Frequency int
Perform actions at most once every X minutes for this issue. Defaults to 30.
Id string
The provider-assigned unique ID for this managed resource.
InternalId string
The internal ID for this issue alert.
Name string
The issue alert name.
Organization string
The slug of the organization the issue alert belongs to.
Project string
The slug of the project the issue alert belongs to.
actionMatch String
Trigger actions when an event is captured by Sentry and any or all of the specified conditions happen.
actions List<Map<String,String>>
List of actions.
conditions List<Map<String,String>>
List of conditions.
environment String
Perform issue alert in a specific environment.
filterMatch String
Trigger actions if all, any, or none of the specified filters match.
filters List<Map<String,String>>
List of filters.
frequency Integer
Perform actions at most once every X minutes for this issue. Defaults to 30.
id String
The provider-assigned unique ID for this managed resource.
internalId String
The internal ID for this issue alert.
name String
The issue alert name.
organization String
The slug of the organization the issue alert belongs to.
project String
The slug of the project the issue alert belongs to.
actionMatch string
Trigger actions when an event is captured by Sentry and any or all of the specified conditions happen.
actions {[key: string]: string}[]
List of actions.
conditions {[key: string]: string}[]
List of conditions.
environment string
Perform issue alert in a specific environment.
filterMatch string
Trigger actions if all, any, or none of the specified filters match.
filters {[key: string]: string}[]
List of filters.
frequency number
Perform actions at most once every X minutes for this issue. Defaults to 30.
id string
The provider-assigned unique ID for this managed resource.
internalId string
The internal ID for this issue alert.
name string
The issue alert name.
organization string
The slug of the organization the issue alert belongs to.
project string
The slug of the project the issue alert belongs to.
action_match str
Trigger actions when an event is captured by Sentry and any or all of the specified conditions happen.
actions Sequence[Mapping[str, str]]
List of actions.
conditions Sequence[Mapping[str, str]]
List of conditions.
environment str
Perform issue alert in a specific environment.
filter_match str
Trigger actions if all, any, or none of the specified filters match.
filters Sequence[Mapping[str, str]]
List of filters.
frequency int
Perform actions at most once every X minutes for this issue. Defaults to 30.
id str
The provider-assigned unique ID for this managed resource.
internal_id str
The internal ID for this issue alert.
name str
The issue alert name.
organization str
The slug of the organization the issue alert belongs to.
project str
The slug of the project the issue alert belongs to.
actionMatch String
Trigger actions when an event is captured by Sentry and any or all of the specified conditions happen.
actions List<Map<String>>
List of actions.
conditions List<Map<String>>
List of conditions.
environment String
Perform issue alert in a specific environment.
filterMatch String
Trigger actions if all, any, or none of the specified filters match.
filters List<Map<String>>
List of filters.
frequency Number
Perform actions at most once every X minutes for this issue. Defaults to 30.
id String
The provider-assigned unique ID for this managed resource.
internalId String
The internal ID for this issue alert.
name String
The issue alert name.
organization String
The slug of the organization the issue alert belongs to.
project String
The slug of the project the issue alert belongs to.

Package Details

Repository
sentry pulumiverse/pulumi-sentry
License
Apache-2.0
Notes
This Pulumi package is based on the sentry Terraform Provider.
Sentry v0.0.9 published on Friday, Nov 15, 2024 by Pulumiverse