Skip to content

Commit 65755af

Browse files
mcedjianyuan
andauthored
Add resolve_age as optional project parameter (#55)
Co-Authored-By: Jian Yuan Lee <jianyuan@gmail.com> Co-authored-by: Jian Yuan Lee <jianyuan@gmail.com>
1 parent 61bc3c9 commit 65755af

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ The following attributes are exported:
9595
# Create a project
9696
resource "sentry_project" "default" {
9797
organization = "my-organization"
98-
team = "my-team"
99-
name = "Web App"
100-
slug = "web-app"
101-
platform = "javascript"
98+
team = "my-team"
99+
name = "Web App"
100+
slug = "web-app"
101+
platform = "javascript"
102+
resolve_age = 720
102103
}
103104
```
104105

@@ -111,6 +112,7 @@ The following arguments are supported:
111112
* `name` - (Required) The human readable name for the project.
112113
* `slug` - (Optional) The unique URL slug for this project. If this is not provided a slug is automatically generated based on the name.
113114
* `platform` - (Optional) The integration platform.
115+
* `resolve_age` - (Optional) Hours in which an issue is automatically resolve if not seen after this amount of time.
114116

115117
##### Attributes Reference
116118

sentry/resource_sentry_project.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ func resourceSentryProject() *schema.Resource {
8383
Type: schema.TypeInt,
8484
Computed: true,
8585
},
86+
"resolve_age": {
87+
Type: schema.TypeInt,
88+
Optional: true
89+
Description: "Hours in which an issue is automatically resolve if not seen after this amount of time.",
90+
Computed: true,
91+
},
8692

8793
// TODO: Project options
8894
},
@@ -132,6 +138,7 @@ func resourceSentryProjectRead(d *schema.ResourceData, meta interface{}) error {
132138
d.Set("status", proj.Status)
133139
d.Set("digests_min_delay", proj.DigestsMinDelay)
134140
d.Set("digests_max_delay", proj.DigestsMaxDelay)
141+
d.Set("resolve_age", proj.ResolveAge)
135142

136143
// TODO: Project options
137144

@@ -161,6 +168,10 @@ func resourceSentryProjectUpdate(d *schema.ResourceData, meta interface{}) error
161168
params.DigestsMaxDelay = Int(v.(int))
162169
}
163170

171+
if v, ok := d.GetOk("resolve_age"); ok {
172+
params.ResolveAge = Int(v.(int))
173+
}
174+
164175
proj, _, err := client.Projects.Update(org, slug, params)
165176
if err != nil {
166177
return err

0 commit comments

Comments
 (0)