sentry.SentryOrganizationCodeMapping
Explore with Pulumi AI
Sentry Organization Code Mapping resource.
Example Usage
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 pulumi
import pulumi_sentry as sentry
import pulumiverse_sentry as sentry
# Retrieve the Github organization integration
github = sentry.get_sentry_organization_integration(organization="my-organization",
    provider_key="github",
    name="my-github-organization")
this = sentry.SentryProject("this",
    organization="my-organization",
    team="my-team",
    name="Web App",
    slug="web-app",
    platform="javascript",
    resolve_age=720)
this_sentry_organization_repository_github = sentry.SentryOrganizationRepositoryGithub("this",
    organization="my-organization",
    integration_id=github.internal_id,
    identifier="my-github-organization/my-github-repo")
this_sentry_organization_code_mapping = sentry.SentryOrganizationCodeMapping("this",
    organization="my-organization",
    integration_id=github.internal_id,
    repository_id=this_sentry_organization_repository_github.internal_id,
    project_id=this.internal_id,
    default_branch="main",
    stack_root="/",
    source_root="src/")
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 {
		// Retrieve the Github organization integration
		github, err := sentry.GetSentryOrganizationIntegration(ctx, &sentry.GetSentryOrganizationIntegrationArgs{
			Organization: "my-organization",
			ProviderKey:  "github",
			Name:         "my-github-organization",
		}, nil)
		if err != nil {
			return err
		}
		this, err := sentry.NewSentryProject(ctx, "this", &sentry.SentryProjectArgs{
			Organization: pulumi.String("my-organization"),
			Team:         pulumi.String("my-team"),
			Name:         pulumi.String("Web App"),
			Slug:         pulumi.String("web-app"),
			Platform:     pulumi.String("javascript"),
			ResolveAge:   pulumi.Int(720),
		})
		if err != nil {
			return err
		}
		thisSentryOrganizationRepositoryGithub, err := sentry.NewSentryOrganizationRepositoryGithub(ctx, "this", &sentry.SentryOrganizationRepositoryGithubArgs{
			Organization:  pulumi.String("my-organization"),
			IntegrationId: pulumi.String(github.InternalId),
			Identifier:    pulumi.String("my-github-organization/my-github-repo"),
		})
		if err != nil {
			return err
		}
		_, err = sentry.NewSentryOrganizationCodeMapping(ctx, "this", &sentry.SentryOrganizationCodeMappingArgs{
			Organization:  pulumi.String("my-organization"),
			IntegrationId: pulumi.String(github.InternalId),
			RepositoryId:  thisSentryOrganizationRepositoryGithub.InternalId,
			ProjectId:     this.InternalId,
			DefaultBranch: pulumi.String("main"),
			StackRoot:     pulumi.String("/"),
			SourceRoot:    pulumi.String("src/"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sentry = Pulumi.Sentry;
using Sentry = Pulumiverse.Sentry;
return await Deployment.RunAsync(() => 
{
    // Retrieve the Github organization integration
    var github = Sentry.GetSentryOrganizationIntegration.Invoke(new()
    {
        Organization = "my-organization",
        ProviderKey = "github",
        Name = "my-github-organization",
    });
    var @this = new Sentry.SentryProject("this", new()
    {
        Organization = "my-organization",
        Team = "my-team",
        Name = "Web App",
        Slug = "web-app",
        Platform = "javascript",
        ResolveAge = 720,
    });
    var thisSentryOrganizationRepositoryGithub = new Sentry.SentryOrganizationRepositoryGithub("this", new()
    {
        Organization = "my-organization",
        IntegrationId = github.Apply(getSentryOrganizationIntegrationResult => getSentryOrganizationIntegrationResult.InternalId),
        Identifier = "my-github-organization/my-github-repo",
    });
    var thisSentryOrganizationCodeMapping = new Sentry.SentryOrganizationCodeMapping("this", new()
    {
        Organization = "my-organization",
        IntegrationId = github.Apply(getSentryOrganizationIntegrationResult => getSentryOrganizationIntegrationResult.InternalId),
        RepositoryId = thisSentryOrganizationRepositoryGithub.InternalId,
        ProjectId = @this.InternalId,
        DefaultBranch = "main",
        StackRoot = "/",
        SourceRoot = "src/",
    });
});
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.GetSentryOrganizationIntegrationArgs;
import com.pulumi.sentry.SentryProject;
import com.pulumi.sentry.SentryProjectArgs;
import com.pulumi.sentry.SentryOrganizationRepositoryGithub;
import com.pulumi.sentry.SentryOrganizationRepositoryGithubArgs;
import com.pulumi.sentry.SentryOrganizationCodeMapping;
import com.pulumi.sentry.SentryOrganizationCodeMappingArgs;
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 the Github organization integration
        final var github = SentryFunctions.getSentryOrganizationIntegration(GetSentryOrganizationIntegrationArgs.builder()
            .organization("my-organization")
            .providerKey("github")
            .name("my-github-organization")
            .build());
        var this_ = new SentryProject("this", SentryProjectArgs.builder()
            .organization("my-organization")
            .team("my-team")
            .name("Web App")
            .slug("web-app")
            .platform("javascript")
            .resolveAge(720)
            .build());
        var thisSentryOrganizationRepositoryGithub = new SentryOrganizationRepositoryGithub("thisSentryOrganizationRepositoryGithub", SentryOrganizationRepositoryGithubArgs.builder()
            .organization("my-organization")
            .integrationId(github.applyValue(getSentryOrganizationIntegrationResult -> getSentryOrganizationIntegrationResult.internalId()))
            .identifier("my-github-organization/my-github-repo")
            .build());
        var thisSentryOrganizationCodeMapping = new SentryOrganizationCodeMapping("thisSentryOrganizationCodeMapping", SentryOrganizationCodeMappingArgs.builder()
            .organization("my-organization")
            .integrationId(github.applyValue(getSentryOrganizationIntegrationResult -> getSentryOrganizationIntegrationResult.internalId()))
            .repositoryId(thisSentryOrganizationRepositoryGithub.internalId())
            .projectId(this_.internalId())
            .defaultBranch("main")
            .stackRoot("/")
            .sourceRoot("src/")
            .build());
    }
}
resources:
  this:
    type: sentry:SentryProject
    properties:
      organization: my-organization
      team: my-team
      name: Web App
      slug: web-app
      platform: javascript
      resolveAge: 720
  thisSentryOrganizationRepositoryGithub:
    type: sentry:SentryOrganizationRepositoryGithub
    name: this
    properties:
      organization: my-organization
      integrationId: ${github.internalId}
      identifier: my-github-organization/my-github-repo
  thisSentryOrganizationCodeMapping:
    type: sentry:SentryOrganizationCodeMapping
    name: this
    properties:
      organization: my-organization
      integrationId: ${github.internalId}
      repositoryId: ${thisSentryOrganizationRepositoryGithub.internalId}
      projectId: ${this.internalId}
      defaultBranch: main
      stackRoot: /
      sourceRoot: src/
variables:
  # Retrieve the Github organization integration
  github:
    fn::invoke:
      Function: sentry:getSentryOrganizationIntegration
      Arguments:
        organization: my-organization
        providerKey: github
        name: my-github-organization
Create SentryOrganizationCodeMapping Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SentryOrganizationCodeMapping(name: string, args: SentryOrganizationCodeMappingArgs, opts?: CustomResourceOptions);@overload
def SentryOrganizationCodeMapping(resource_name: str,
                                  args: SentryOrganizationCodeMappingArgs,
                                  opts: Optional[ResourceOptions] = None)
@overload
def SentryOrganizationCodeMapping(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  default_branch: Optional[str] = None,
                                  integration_id: Optional[str] = None,
                                  organization: Optional[str] = None,
                                  project_id: Optional[str] = None,
                                  repository_id: Optional[str] = None,
                                  source_root: Optional[str] = None,
                                  stack_root: Optional[str] = None)func NewSentryOrganizationCodeMapping(ctx *Context, name string, args SentryOrganizationCodeMappingArgs, opts ...ResourceOption) (*SentryOrganizationCodeMapping, error)public SentryOrganizationCodeMapping(string name, SentryOrganizationCodeMappingArgs args, CustomResourceOptions? opts = null)
public SentryOrganizationCodeMapping(String name, SentryOrganizationCodeMappingArgs args)
public SentryOrganizationCodeMapping(String name, SentryOrganizationCodeMappingArgs args, CustomResourceOptions options)
type: sentry:SentryOrganizationCodeMapping
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 SentryOrganizationCodeMappingArgs
- 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 SentryOrganizationCodeMappingArgs
- 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 SentryOrganizationCodeMappingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SentryOrganizationCodeMappingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SentryOrganizationCodeMappingArgs
- 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 sentryOrganizationCodeMappingResource = new Sentry.SentryOrganizationCodeMapping("sentryOrganizationCodeMappingResource", new()
{
    DefaultBranch = "string",
    IntegrationId = "string",
    Organization = "string",
    ProjectId = "string",
    RepositoryId = "string",
    SourceRoot = "string",
    StackRoot = "string",
});
example, err := sentry.NewSentryOrganizationCodeMapping(ctx, "sentryOrganizationCodeMappingResource", &sentry.SentryOrganizationCodeMappingArgs{
	DefaultBranch: pulumi.String("string"),
	IntegrationId: pulumi.String("string"),
	Organization:  pulumi.String("string"),
	ProjectId:     pulumi.String("string"),
	RepositoryId:  pulumi.String("string"),
	SourceRoot:    pulumi.String("string"),
	StackRoot:     pulumi.String("string"),
})
var sentryOrganizationCodeMappingResource = new SentryOrganizationCodeMapping("sentryOrganizationCodeMappingResource", SentryOrganizationCodeMappingArgs.builder()
    .defaultBranch("string")
    .integrationId("string")
    .organization("string")
    .projectId("string")
    .repositoryId("string")
    .sourceRoot("string")
    .stackRoot("string")
    .build());
sentry_organization_code_mapping_resource = sentry.SentryOrganizationCodeMapping("sentryOrganizationCodeMappingResource",
    default_branch="string",
    integration_id="string",
    organization="string",
    project_id="string",
    repository_id="string",
    source_root="string",
    stack_root="string")
const sentryOrganizationCodeMappingResource = new sentry.SentryOrganizationCodeMapping("sentryOrganizationCodeMappingResource", {
    defaultBranch: "string",
    integrationId: "string",
    organization: "string",
    projectId: "string",
    repositoryId: "string",
    sourceRoot: "string",
    stackRoot: "string",
});
type: sentry:SentryOrganizationCodeMapping
properties:
    defaultBranch: string
    integrationId: string
    organization: string
    projectId: string
    repositoryId: string
    sourceRoot: string
    stackRoot: string
SentryOrganizationCodeMapping 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 SentryOrganizationCodeMapping resource accepts the following input properties:
- DefaultBranch string
- Default branch of your code we fall back to if you do not have commit tracking set up.
- IntegrationId string
- Sentry Organization Integration ID.
- Organization string
- The slug of the organization the code mapping is under.
- ProjectId string
- Sentry Project ID.
- RepositoryId string
- Sentry Organization Repository ID.
- SourceRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- StackRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- DefaultBranch string
- Default branch of your code we fall back to if you do not have commit tracking set up.
- IntegrationId string
- Sentry Organization Integration ID.
- Organization string
- The slug of the organization the code mapping is under.
- ProjectId string
- Sentry Project ID.
- RepositoryId string
- Sentry Organization Repository ID.
- SourceRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- StackRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- defaultBranch String
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integrationId String
- Sentry Organization Integration ID.
- organization String
- The slug of the organization the code mapping is under.
- projectId String
- Sentry Project ID.
- repositoryId String
- Sentry Organization Repository ID.
- sourceRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stackRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- defaultBranch string
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integrationId string
- Sentry Organization Integration ID.
- organization string
- The slug of the organization the code mapping is under.
- projectId string
- Sentry Project ID.
- repositoryId string
- Sentry Organization Repository ID.
- sourceRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stackRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- default_branch str
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integration_id str
- Sentry Organization Integration ID.
- organization str
- The slug of the organization the code mapping is under.
- project_id str
- Sentry Project ID.
- repository_id str
- Sentry Organization Repository ID.
- source_root str
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stack_root str
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- defaultBranch String
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integrationId String
- Sentry Organization Integration ID.
- organization String
- The slug of the organization the code mapping is under.
- projectId String
- Sentry Project ID.
- repositoryId String
- Sentry Organization Repository ID.
- sourceRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stackRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
Outputs
All input properties are implicitly available as output properties. Additionally, the SentryOrganizationCodeMapping resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- InternalId string
- The internal ID for this resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- InternalId string
- The internal ID for this resource.
- id String
- The provider-assigned unique ID for this managed resource.
- internalId String
- The internal ID for this resource.
- id string
- The provider-assigned unique ID for this managed resource.
- internalId string
- The internal ID for this resource.
- id str
- The provider-assigned unique ID for this managed resource.
- internal_id str
- The internal ID for this resource.
- id String
- The provider-assigned unique ID for this managed resource.
- internalId String
- The internal ID for this resource.
Look up Existing SentryOrganizationCodeMapping Resource
Get an existing SentryOrganizationCodeMapping 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?: SentryOrganizationCodeMappingState, opts?: CustomResourceOptions): SentryOrganizationCodeMapping@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        default_branch: Optional[str] = None,
        integration_id: Optional[str] = None,
        internal_id: Optional[str] = None,
        organization: Optional[str] = None,
        project_id: Optional[str] = None,
        repository_id: Optional[str] = None,
        source_root: Optional[str] = None,
        stack_root: Optional[str] = None) -> SentryOrganizationCodeMappingfunc GetSentryOrganizationCodeMapping(ctx *Context, name string, id IDInput, state *SentryOrganizationCodeMappingState, opts ...ResourceOption) (*SentryOrganizationCodeMapping, error)public static SentryOrganizationCodeMapping Get(string name, Input<string> id, SentryOrganizationCodeMappingState? state, CustomResourceOptions? opts = null)public static SentryOrganizationCodeMapping get(String name, Output<String> id, SentryOrganizationCodeMappingState state, CustomResourceOptions options)resources:  _:    type: sentry:SentryOrganizationCodeMapping    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.
- DefaultBranch string
- Default branch of your code we fall back to if you do not have commit tracking set up.
- IntegrationId string
- Sentry Organization Integration ID.
- InternalId string
- The internal ID for this resource.
- Organization string
- The slug of the organization the code mapping is under.
- ProjectId string
- Sentry Project ID.
- RepositoryId string
- Sentry Organization Repository ID.
- SourceRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- StackRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- DefaultBranch string
- Default branch of your code we fall back to if you do not have commit tracking set up.
- IntegrationId string
- Sentry Organization Integration ID.
- InternalId string
- The internal ID for this resource.
- Organization string
- The slug of the organization the code mapping is under.
- ProjectId string
- Sentry Project ID.
- RepositoryId string
- Sentry Organization Repository ID.
- SourceRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- StackRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- defaultBranch String
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integrationId String
- Sentry Organization Integration ID.
- internalId String
- The internal ID for this resource.
- organization String
- The slug of the organization the code mapping is under.
- projectId String
- Sentry Project ID.
- repositoryId String
- Sentry Organization Repository ID.
- sourceRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stackRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- defaultBranch string
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integrationId string
- Sentry Organization Integration ID.
- internalId string
- The internal ID for this resource.
- organization string
- The slug of the organization the code mapping is under.
- projectId string
- Sentry Project ID.
- repositoryId string
- Sentry Organization Repository ID.
- sourceRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stackRoot string
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- default_branch str
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integration_id str
- Sentry Organization Integration ID.
- internal_id str
- The internal ID for this resource.
- organization str
- The slug of the organization the code mapping is under.
- project_id str
- Sentry Project ID.
- repository_id str
- Sentry Organization Repository ID.
- source_root str
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stack_root str
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- defaultBranch String
- Default branch of your code we fall back to if you do not have commit tracking set up.
- integrationId String
- Sentry Organization Integration ID.
- internalId String
- The internal ID for this resource.
- organization String
- The slug of the organization the code mapping is under.
- projectId String
- Sentry Project ID.
- repositoryId String
- Sentry Organization Repository ID.
- sourceRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
- stackRoot String
- https://docs.sentry.io/product/integrations/source-code-mgmt/github/#stack-trace-linking
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”
$ pulumi import sentry:index/sentryOrganizationCodeMapping:SentryOrganizationCodeMapping this org-slug/31347
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- sentry pulumiverse/pulumi-sentry
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the sentryTerraform Provider.