@pulumiverse/sentry
Version:
A Pulumi package for creating and managing Sentry resources.
211 lines • 9.19 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SentryIssueAlert = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Sentry Issue Alert 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 issue alert on Sentry or inspect [Sentry's rules registry in the source code](https://github.com/getsentry/sentry/tree/master/src/sentry/rules). Since v0.11.2, you should also omit the name property of each condition, filter, and action.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sentry from "@pulumi/sentry";
* import * as sentry from "@pulumiverse/sentry";
*
* // Retrieve a Slack integration
* const slack = sentry.getSentryOrganizationIntegration({
* organization: test.organization,
* providerKey: "slack",
* name: "Slack Workspace",
* });
* const main = new sentry.SentryIssueAlert("main", {
* organization: mainSentryProject.organization,
* project: mainSentryProject.id,
* name: "My issue alert",
* actionMatch: "any",
* filterMatch: "any",
* frequency: 30,
* conditions: [
* {
* id: "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition",
* },
* {
* id: "sentry.rules.conditions.regression_event.RegressionEventCondition",
* },
* {
* id: "sentry.rules.conditions.event_frequency.EventFrequencyCondition",
* value: "100",
* comparisonType: "count",
* interval: "1h",
* },
* {
* id: "sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition",
* value: "100",
* comparisonType: "count",
* interval: "1h",
* },
* {
* id: "sentry.rules.conditions.event_frequency.EventFrequencyPercentCondition",
* value: "50.0",
* comparisonType: "count",
* interval: "1h",
* },
* ],
* filters: [
* {
* id: "sentry.rules.filters.age_comparison.AgeComparisonFilter",
* value: "10",
* time: "minute",
* comparison_type: "older",
* },
* {
* id: "sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter",
* value: "10",
* },
* {
* id: "sentry.rules.filters.assigned_to.AssignedToFilter",
* targetType: "Team",
* targetIdentifier: mainSentryTeam.teamId,
* },
* {
* id: "sentry.rules.filters.latest_release.LatestReleaseFilter",
* },
* {
* id: "sentry.rules.filters.event_attribute.EventAttributeFilter",
* attribute: "message",
* match: "co",
* value: "test",
* },
* {
* id: "sentry.rules.filters.tagged_event.TaggedEventFilter",
* key: "test",
* match: "co",
* value: "test",
* },
* {
* id: "sentry.rules.filters.level.LevelFilter",
* match: "eq",
* level: "50",
* },
* ],
* actions: [
* {
* id: "sentry.mail.actions.NotifyEmailAction",
* targetType: "IssueOwners",
* targetIdentifier: "",
* },
* {
* id: "sentry.mail.actions.NotifyEmailAction",
* targetType: "Team",
* targetIdentifier: mainSentryTeam.teamId,
* },
* {
* id: "sentry.rules.actions.notify_event.NotifyEventAction",
* },
* {
* id: "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
* channel: "#general",
* workspace: slack.then(slack => slack.internalId),
* },
* ],
* });
* ```
*
* ## Import
*
* import using the organization, project slugs and rule id from the URL:
*
* https://sentry.io/organizations/[org-slug]/alerts/rules/[project-slug]/[rule-id]/details/
*
* ```sh
* $ pulumi import sentry:index/sentryIssueAlert:SentryIssueAlert default org-slug/project-slug/rule-id
* ```
*/
class SentryIssueAlert extends pulumi.CustomResource {
/**
* Get an existing SentryIssueAlert resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new SentryIssueAlert(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SentryIssueAlert. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SentryIssueAlert.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["actionMatch"] = state ? state.actionMatch : undefined;
resourceInputs["actions"] = state ? state.actions : undefined;
resourceInputs["conditions"] = state ? state.conditions : undefined;
resourceInputs["environment"] = state ? state.environment : undefined;
resourceInputs["filterMatch"] = state ? state.filterMatch : undefined;
resourceInputs["filters"] = state ? state.filters : undefined;
resourceInputs["frequency"] = state ? state.frequency : undefined;
resourceInputs["internalId"] = state ? state.internalId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["organization"] = state ? state.organization : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["projects"] = state ? state.projects : undefined;
}
else {
const args = argsOrState;
if ((!args || args.actionMatch === undefined) && !opts.urn) {
throw new Error("Missing required property 'actionMatch'");
}
if ((!args || args.actions === undefined) && !opts.urn) {
throw new Error("Missing required property 'actions'");
}
if ((!args || args.conditions === undefined) && !opts.urn) {
throw new Error("Missing required property 'conditions'");
}
if ((!args || args.filterMatch === undefined) && !opts.urn) {
throw new Error("Missing required property 'filterMatch'");
}
if ((!args || args.frequency === undefined) && !opts.urn) {
throw new Error("Missing required property 'frequency'");
}
if ((!args || args.organization === undefined) && !opts.urn) {
throw new Error("Missing required property 'organization'");
}
if ((!args || args.project === undefined) && !opts.urn) {
throw new Error("Missing required property 'project'");
}
resourceInputs["actionMatch"] = args ? args.actionMatch : undefined;
resourceInputs["actions"] = args ? args.actions : undefined;
resourceInputs["conditions"] = args ? args.conditions : undefined;
resourceInputs["environment"] = args ? args.environment : undefined;
resourceInputs["filterMatch"] = args ? args.filterMatch : undefined;
resourceInputs["filters"] = args ? args.filters : undefined;
resourceInputs["frequency"] = args ? args.frequency : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["organization"] = args ? args.organization : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["internalId"] = undefined /*out*/;
resourceInputs["projects"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SentryIssueAlert.__pulumiType, name, resourceInputs, opts);
}
}
exports.SentryIssueAlert = SentryIssueAlert;
/** @internal */
SentryIssueAlert.__pulumiType = 'sentry:index/sentryIssueAlert:SentryIssueAlert';
//# sourceMappingURL=sentryIssueAlert.js.map