Skip to content

Commit fd2f0b7

Browse files
committed
Merge branch 'master' into emichaeli-add-policies-resource
2 parents e4b5eed + 54ccf32 commit fd2f0b7

File tree

2,544 files changed

+1951
-812045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,544 files changed

+1951
-812045
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: Set up Go
2929
uses: actions/setup-go@v2
3030
with:
31-
go-version: 1.14
31+
go-version: 1.16
3232
-
3333
name: Import GPG key
3434
id: import_gpg
@@ -44,4 +44,4 @@ jobs:
4444
args: release --rm-dist
4545
env:
4646
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up Go
3131
uses: actions/[email protected]
3232
with:
33-
go-version: '1.15'
33+
go-version: '1.16'
3434
id: go
3535

3636
- name: Check out code into the Go module directory
@@ -53,15 +53,13 @@ jobs:
5353
matrix:
5454
# list whatever Terraform versions here you would like to support
5555
terraform:
56-
# - '0.12.29'
57-
- '0.13.4'
58-
# - '0.14.0-beta2'
56+
- '1.0.3'
5957
steps:
6058

6159
- name: Set up Go
6260
uses: actions/[email protected]
6361
with:
64-
go-version: '1.15'
62+
go-version: '1.16'
6563
id: go
6664

6765
- name: Check out code into the Go module directory

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.13.8
1+
1.16.6

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
## 2.9.7 (Unreleased)
1+
## 2.9.9 (Unreleased)
2+
3+
BUG FIXES:
4+
5+
* resource/sumologic_monitor: Removed deprecation warning for `triggers`.
6+
* seperated docs for sumologic_monitor_folder from docs for sumologic_monitor.
7+
* resource/sumologic_monitor: Fixed docs for `trigger_conditions`.
8+
9+
## 2.9.8 (July 30, 2021)
10+
11+
FEATURES:
12+
13+
* Add support for ServiceNow Incident and Event webhook connection (GH-250)
14+
* Add support for new detection methods to sumologic_monitor (GH-239)
15+
16+
DEPRECATIONS:
17+
18+
* resource/sumologic_monitor: Deprecated `triggers` in favor of `trigger_conditions` (GH-239)
19+
20+
BUG FIXES:
21+
22+
* datasource/sumologic_http_source: fix int64 conversion for `collector_id` (GH-251)
23+
24+
## 2.9.7 (July 22, 2021)
25+
26+
ENHANCEMENTS:
27+
28+
* Upgrade GoLang to support arm_64 (GH-241)
229

330
## 2.9.6 (July 9, 2021)
431

go.mod

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
11
module github.com/SumoLogic/terraform-provider-sumologic
22

3-
go 1.12
3+
go 1.16
44

55
require (
6-
cloud.google.com/go/pubsub v1.2.0 // indirect
7-
github.com/aws/aws-sdk-go v1.28.14 // indirect
8-
github.com/fatih/color v1.9.0 // indirect
9-
github.com/go-errors/errors v1.0.1
10-
github.com/go-test/deep v1.0.5 // indirect
11-
github.com/golang/mock v1.4.0 // indirect
12-
github.com/hashicorp/go-hclog v0.12.0 // indirect
6+
cloud.google.com/go v0.88.0 // indirect
7+
github.com/aws/aws-sdk-go v1.40.10 // indirect
8+
github.com/fatih/color v1.12.0 // indirect
9+
github.com/go-errors/errors v1.4.0
10+
github.com/go-test/deep v1.0.7 // indirect
11+
github.com/hashicorp/go-hclog v0.16.2 // indirect
1312
github.com/hashicorp/go-uuid v1.0.2 // indirect
1413
github.com/hashicorp/hcl v1.0.0 // indirect
15-
github.com/hashicorp/terraform v0.12.24
16-
github.com/hashicorp/terraform-config-inspect v0.0.0-20200210163047-f7d8399e1194 // indirect
17-
github.com/hashicorp/terraform-plugin-sdk v1.7.0
18-
github.com/hashicorp/terraform-svchost v0.0.0-20191119180714-d2e4933b9136 // indirect
19-
github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect
20-
github.com/kr/pretty v0.2.0 // indirect
21-
github.com/mattn/go-isatty v0.0.12 // indirect
14+
github.com/hashicorp/terraform-config-inspect v0.0.0-20210625153042-09f34846faab // indirect
15+
github.com/hashicorp/terraform-plugin-sdk v1.17.2
16+
github.com/hashicorp/yamux v0.0.0-20210707203944-259a57b3608c // indirect
17+
github.com/mattn/go-isatty v0.0.13 // indirect
2218
github.com/oklog/run v1.1.0 // indirect
2319
github.com/posener/complete v1.2.3 // indirect
24-
github.com/sergi/go-diff v1.1.0 // indirect
25-
github.com/ulikunitz/xz v0.5.6 // indirect
26-
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
27-
golang.org/x/crypto v0.0.0-20200210222208-86ce3cb69678 // indirect
28-
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd // indirect
29-
golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2 // indirect
30-
google.golang.org/api v0.17.0 // indirect
31-
google.golang.org/genproto v0.0.0-20200210034751-acff78025515 // indirect
32-
google.golang.org/grpc v1.27.1 // indirect
33-
gopkg.in/yaml.v2 v2.2.8 // indirect
20+
github.com/ulikunitz/xz v0.5.10 // indirect
3421
)

go.sum

Lines changed: 437 additions & 308 deletions
Large diffs are not rendered by default.

sumologic/data_source_sumologic_http_source.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,16 @@ func dataSourceSumologicHTTPSourceRead(d *schema.ResourceData, meta interface{})
5555
c := meta.(*Client)
5656

5757
id, _ := strconv.Atoi(d.Id())
58-
source, err := c.GetSourceName(d.Get("collector_id").(int64), d.Get("name").(string))
58+
var collectorId int64
59+
switch cid := d.Get("collector_id").(type) {
60+
case int:
61+
collectorId = int64(cid)
62+
case int64:
63+
collectorId = cid
64+
default:
65+
return fmt.Errorf("unknown data type of collector_id: %T, value: %v", cid, cid)
66+
}
67+
source, err := c.GetSourceName(collectorId, d.Get("name").(string))
5968

6069
if err != nil {
6170
return err

sumologic/data_source_sumologic_role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func dataSourceSumologicRole() *schema.Resource {
3434
Computed: true,
3535
},
3636
"capabilities": {
37-
Type: schema.TypeList,
37+
Type: schema.TypeSet,
3838
Computed: true,
3939
Elem: &schema.Schema{
4040
Type: schema.TypeString,

sumologic/provider.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"strings"
99

1010
"github.com/go-errors/errors"
11-
"github.com/hashicorp/terraform-plugin-sdk/helper/mutexkv"
1211
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
1312
"github.com/hashicorp/terraform-plugin-sdk/terraform"
1413
)
@@ -90,8 +89,6 @@ func Provider() terraform.ResourceProvider {
9089
}
9190
}
9291

93-
var SumoMutexKV = mutexkv.NewMutexKV()
94-
9592
func resolveRedirectURL(accessId string, accessKey string) (string, error) {
9693
req, err := http.NewRequest(http.MethodHead, "https://api.sumologic.com/api/v1/collectors", nil)
9794
if err != nil {

sumologic/resource_sumologic_connection.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ func resourceSumologicConnection() *schema.Resource {
7777
"webhook_type": {
7878
Type: schema.TypeString,
7979
Optional: true,
80-
ValidateFunc: validation.StringInSlice([]string{"AWSLambda", "Azure", "Datadog", "HipChat", "PagerDuty", "Slack", "Webhook", "NewRelic", "Jira", "Opsgenie", "MicrosoftTeams"}, false),
80+
ValidateFunc: validation.StringInSlice([]string{"AWSLambda", "Azure", "Datadog", "HipChat", "PagerDuty", "Slack", "Webhook", "NewRelic", "Jira", "Opsgenie", "MicrosoftTeams", "ServiceNow"}, false),
8181
Default: "Webhook",
8282
},
83+
"connection_subtype": {
84+
Type: schema.TypeString,
85+
Optional: true,
86+
ValidateFunc: validation.StringInSlice([]string{"Incident", "Event"}, false),
87+
},
8388
},
8489
}
8590
}
@@ -136,6 +141,7 @@ func resourceSumologicConnectionRead(d *schema.ResourceData, meta interface{}) e
136141
}
137142
d.Set("default_payload", connection.DefaultPayload)
138143
d.Set("webhook_type", connection.WebhookType)
144+
d.Set("connection_subtype", connection.ConnectionSubtype)
139145
d.SetId(connection.ID)
140146

141147
log.Println("====End Connection Read====")
@@ -201,6 +207,7 @@ func resourceToConnection(d *schema.ResourceData) Connection {
201207
connection.CustomHeaders = mapToHeaders(d.Get("custom_headers").(map[string]interface{}))
202208
connection.DefaultPayload = d.Get("default_payload").(string)
203209
connection.WebhookType = d.Get("webhook_type").(string)
210+
connection.ConnectionSubtype = d.Get("connection_subtype").(string)
204211

205212
return connection
206213
}
@@ -233,4 +240,5 @@ func printConnection(connection Connection) {
233240
log.Printf("CustomHeaders: %s", connection.CustomHeaders)
234241
log.Printf("DefaultPayload: %s", connection.DefaultPayload)
235242
log.Printf("WebhookType: %s", connection.WebhookType)
243+
log.Printf("ConnectionSubtype: %s", connection.ConnectionSubtype)
236244
}

0 commit comments

Comments
 (0)