Skip to content

Commit

Permalink
Merge branch 'drivetopurchase-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyuan committed Sep 27, 2019
2 parents 5a75be8 + 575e4e9 commit 3e700f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ The following attributes are exported:
# Create a project
resource "sentry_project" "default" {
organization = "my-organization"
team = "my-team"
name = "Web App"
slug = "web-app"
team = "my-team"
name = "Web App"
slug = "web-app"
platform = "javascript"
}
```

Expand All @@ -109,6 +110,7 @@ The following arguments are supported:
* `team` - (Required) The slug of the team the project should be created for.
* `name` - (Required) The human readable name for the project.
* `slug` - (Optional) The unique URL slug for this project. If this is not provided a slug is automatically generated based on the name.
* `platform` - (Optional) The integration platform.

##### Attributes Reference

Expand Down
12 changes: 12 additions & 0 deletions sentry/resource_sentry_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ func resourceSentryProject() *schema.Resource {
Description: "The optional slug for this project",
Computed: true,
},
"platform": {
Type: schema.TypeString,
Optional: true,
Description: "The optional platform for this project",
Computed: true,
},
"project_id": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -119,6 +125,7 @@ func resourceSentryProjectRead(d *schema.ResourceData, meta interface{}) error {
d.Set("team", proj.Team.Slug)
d.Set("name", proj.Name)
d.Set("slug", proj.Slug)
d.Set("platform", proj.Platform)
d.Set("project_id", proj.ID)
d.Set("is_public", proj.IsPublic)
d.Set("color", proj.Color)
Expand All @@ -142,6 +149,11 @@ func resourceSentryProjectUpdate(d *schema.ResourceData, meta interface{}) error
Slug: d.Get("slug").(string),
}

platform := d.Get("platform").(string)
if platform != "" {
params.Platform = platform
}

if v, ok := d.GetOk("digests_min_delay"); ok {
params.DigestsMinDelay = Int(v.(int))
}
Expand Down

0 comments on commit 3e700f6

Please sign in to comment.