Skip to content

Commit dc41887

Browse files
authored
Track terms acceptance on organization creation (#23)
* Track terms acceptance on organization creation * Update README.md
1 parent bb4c42c commit dc41887

File tree

9 files changed

+75
-19
lines changed

9 files changed

+75
-19
lines changed

Gopkg.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
[![CircleCI](https://circleci.com/gh/jianyuan/terraform-provider-sentry/tree/master.svg?style=svg)](https://circleci.com/gh/jianyuan/terraform-provider-sentry/tree/master)
33
[![Go Report Card](https://goreportcard.com/badge/github.com/jianyuan/terraform-provider-sentry)](https://goreportcard.com/report/github.com/jianyuan/terraform-provider-sentry)
44

5-
Terraform provider for [Sentry](https://sentry.io)
5+
Terraform provider for [Sentry](https://sentry.io).
6+
7+
## Installation
8+
9+
See the [the Provider Configuration page of the Terraform documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins) for instructions.
10+
11+
Pre-compiled binaries are available from the [Releases](https://github.com/jianyuan/terraform-provider-sentry/releases) page.
612

713
## Usage
814

@@ -36,6 +42,7 @@ The following arguments are supported:
3642
resource "sentry_organization" "default" {
3743
name = "My Organization"
3844
slug = "my-organization"
45+
agree_terms = true
3946
}
4047
```
4148

@@ -45,6 +52,7 @@ The following arguments are supported:
4552

4653
* `name` - (Required) The human readable name for the organization.
4754
* `slug` - (Optional) The unique URL slug for this organization. If this is not provided a slug is automatically generated based on the name.
55+
* `agree_terms` - (Required) You agree to the applicable terms of service and privacy policy.
4856

4957
##### Attributes Reference
5058

example/sentry.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ provider "sentry" {
55

66
resource "sentry_organization" "my_organization" {
77
name = "My Organization"
8+
agree_terms = true
89
}
910

1011
resource "sentry_team" "engineering" {

sentry/helpers.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package sentry
2+
3+
// Bool returns a pointer to the bool value.
4+
func Bool(v bool) *bool {
5+
return &v
6+
}
7+
8+
// Int returns a pointer to the int value.
9+
func Int(v int) *int {
10+
return &v
11+
}

sentry/resource_sentry_organization.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ func resourceSentryOrganization() *schema.Resource {
2929
Description: "The unique URL slug for this organization",
3030
Computed: true,
3131
},
32+
"agree_terms": {
33+
Type: schema.TypeBool,
34+
Required: true,
35+
Description: "You agree to the applicable terms of service and privacy policy",
36+
},
3237
},
3338
}
3439
}
@@ -37,14 +42,14 @@ func resourceSentryOrganizationCreate(d *schema.ResourceData, meta interface{})
3742
client := meta.(*sentry.Client)
3843

3944
params := &sentry.CreateOrganizationParams{
40-
Name: d.Get("name").(string),
41-
Slug: d.Get("slug").(string),
45+
Name: d.Get("name").(string),
46+
Slug: d.Get("slug").(string),
47+
AgreeTerms: sentry.Bool(d.Get("agree_terms").(bool)),
4248
}
4349
log.Printf("[DEBUG] Creating Sentry organization %s", params.Name)
4450

4551
org, _, err := client.Organizations.Create(params)
4652
if err != nil {
47-
log.Printf("[DEBUG] HELLO")
4853
return err
4954
}
5055

sentry/type_utils.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

vendor/github.com/jianyuan/go-sentry/sentry/helpers.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/jianyuan/go-sentry/sentry/organizations.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/jianyuan/go-sentry/sentry/organizations_test.go

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)