UNPKG

@pulumiverse/sentry

Version:

A Pulumi package for creating and managing Sentry resources.

132 lines 6.16 kB
"use strict"; // *** 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.SentryOrganizationCodeMapping = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Sentry Organization Code Mapping resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sentry from "@pulumi/sentry"; * import * as sentry from "@pulumiverse/sentry"; * * // Retrieve the Github organization integration * const github = sentry.getSentryOrganizationIntegration({ * organization: "my-organization", * providerKey: "github", * name: "my-github-organization", * }); * const _this = new sentry.SentryProject("this", { * organization: "my-organization", * team: "my-team", * name: "Web App", * slug: "web-app", * platform: "javascript", * resolveAge: 720, * }); * const thisSentryOrganizationRepositoryGithub = new sentry.SentryOrganizationRepositoryGithub("this", { * organization: "my-organization", * integrationId: github.then(github => github.internalId), * identifier: "my-github-organization/my-github-repo", * }); * const thisSentryOrganizationCodeMapping = new sentry.SentryOrganizationCodeMapping("this", { * organization: "my-organization", * integrationId: github.then(github => github.internalId), * repositoryId: thisSentryOrganizationRepositoryGithub.internalId, * projectId: _this.internalId, * defaultBranch: "main", * stackRoot: "/", * sourceRoot: "src/", * }); * ``` * * ## Import * * import using the organization slug from the URL: * * https://sentry.io/settings/[org-slug]/integrations/github/[org-integration-id]/ * * and inspect network tab for request to https://sentry.io/api/0/organizations/[org-slug]/code-mappings/ * * find the corresponding list element and reference [code-mapping-id] from the key "id" * * ```sh * $ pulumi import sentry:index/sentryOrganizationCodeMapping:SentryOrganizationCodeMapping this org-slug/31347 * ``` */ class SentryOrganizationCodeMapping extends pulumi.CustomResource { /** * Get an existing SentryOrganizationCodeMapping 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 SentryOrganizationCodeMapping(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SentryOrganizationCodeMapping. 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'] === SentryOrganizationCodeMapping.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["defaultBranch"] = state ? state.defaultBranch : undefined; resourceInputs["integrationId"] = state ? state.integrationId : undefined; resourceInputs["internalId"] = state ? state.internalId : undefined; resourceInputs["organization"] = state ? state.organization : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["repositoryId"] = state ? state.repositoryId : undefined; resourceInputs["sourceRoot"] = state ? state.sourceRoot : undefined; resourceInputs["stackRoot"] = state ? state.stackRoot : undefined; } else { const args = argsOrState; if ((!args || args.defaultBranch === undefined) && !opts.urn) { throw new Error("Missing required property 'defaultBranch'"); } if ((!args || args.integrationId === undefined) && !opts.urn) { throw new Error("Missing required property 'integrationId'"); } if ((!args || args.organization === undefined) && !opts.urn) { throw new Error("Missing required property 'organization'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.repositoryId === undefined) && !opts.urn) { throw new Error("Missing required property 'repositoryId'"); } resourceInputs["defaultBranch"] = args ? args.defaultBranch : undefined; resourceInputs["integrationId"] = args ? args.integrationId : undefined; resourceInputs["organization"] = args ? args.organization : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["repositoryId"] = args ? args.repositoryId : undefined; resourceInputs["sourceRoot"] = args ? args.sourceRoot : undefined; resourceInputs["stackRoot"] = args ? args.stackRoot : undefined; resourceInputs["internalId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SentryOrganizationCodeMapping.__pulumiType, name, resourceInputs, opts); } } exports.SentryOrganizationCodeMapping = SentryOrganizationCodeMapping; /** @internal */ SentryOrganizationCodeMapping.__pulumiType = 'sentry:index/sentryOrganizationCodeMapping:SentryOrganizationCodeMapping'; //# sourceMappingURL=sentryOrganizationCodeMapping.js.map