Skip to content

Commit 97a62bf

Browse files
Merge branch 'DET-728' of https://github.com/SumoLogic/terraform-provider-sumologic into DET-728
2 parents a51d04f + c90197c commit 97a62bf

34 files changed

+558
-236
lines changed

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### Description
2+
3+
<!-- Write an overview of the changes, and the reason for making the changes -->
4+
5+
### Check list
6+
* [ ] Describe the changes and their purpose
7+
* [ ] Update HTML docs (if applicable)
8+
* [preview tool](https://registry.terraform.io/tools/doc-preview)
9+
* [ ] Update [`CHANGELOG.md`](../CHANGELOG.md)
10+
* [ ] Check [`CONTRIBUTING.md`](../CONTRIBUTING.md) for anything forgotten

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- '**'
4141
- '!README.md'
4242
- '!CHANGELOG.md'
43+
- '!CONTRIBUTING.md'
4344
- '!website/**'
4445
# ensure the code builds...
4546
build:
@@ -75,7 +76,7 @@ jobs:
7576
matrix:
7677
# list whatever Terraform versions here you would like to support
7778
terraform:
78-
- '1.0.3'
79+
- '1.7.5'
7980
steps:
8081
- name: Set up Go
8182
uses: actions/[email protected]

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
## X.Y.Z (Unreleased)
22
* Add new change notes here
33

4-
FEATURES:
5-
6-
## 3.1.3 (July 31, 2025)
4+
## 3.1.4 (August 15, 2025)
75

86
ENHANCEMENTS:
97
* Added support for overriding sumo built-in rules
8+
* Updated Terraform version in GitHub Actions tests to 1.7.5
9+
10+
## 3.1.3 (August 6, 2025)
11+
12+
BUG FIXES:
13+
* Corrected selection_type configuration in RolesV2 resources.
14+
15+
FEATURES:
16+
* The **sumologic_role_v2** resource has been promoted from Beta to General Availability (GA).
17+
* **New Resource:** sumologic_local_windows_event_log_source (GH-785)
18+
19+
MAINTENANCE:
20+
* Removed obsolete comments about auto-generated code. All code in this repo is eligible for by-hand modification.
21+
* Add a [guide for contributors](CONTRIBUTING.md)
1022

1123
## 3.1.2 (July 24, 2025)
1224

CONTRIBUTING.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Contributing
2+
3+
## Common Contributions
4+
5+
### Add a new resource
6+
7+
Example PR: [link](https://github.com/SumoLogic/terraform-provider-sumologic/pull/710)
8+
9+
* Code
10+
* `sumologic/sumologic_foo.go`
11+
* data type
12+
* functions to interact with [Sumo Logic API](https://help.sumologic.com/docs/api/)
13+
* `sumologic/resource_sumologic_foo.go`
14+
* schema
15+
* functions to interact with tf state
16+
* `sumologic/resource_sumologic_foo_test.go`
17+
* acceptance tests
18+
* `sumologic/provider.go`
19+
* add the new resource to the `ResourcesMap`
20+
* Documentation ([preview tool](https://registry.terraform.io/tools/doc-preview))
21+
* `website/docs/r/foo.html.markdown`
22+
* purpose
23+
* example usage
24+
* detailed reference
25+
* `CHANGELOG.md`
26+
* leave the `## X.Y.Z (Unreleased)` header
27+
* a new version number will be selected only when a release is cut
28+
* add your new changes under `* Add new change notes here` (and do not delete this line)
29+
30+
### Add a new data source
31+
32+
Example PR: [link](https://github.com/SumoLogic/terraform-provider-sumologic/pull/762)
33+
34+
* Code
35+
* `sumologic/sumologic_foo.go`
36+
* data type
37+
* functions to interact with [Sumo Logic API](https://help.sumologic.com/docs/api/)
38+
* `sumologic/data_source_sumologic_foo.go` (singular, for reading one)
39+
* schema
40+
* functions to read into the tf state
41+
* `sumologic/data_source_sumologic_foos.go` (plural, for reading multiple)
42+
* schema
43+
* functions to read into the tf state
44+
* `sumologic/resource_sumologic_foo_test.go` (singular)
45+
* acceptance tests
46+
* `sumologic/resource_sumologic_foos_test.go` (plural)
47+
* acceptance tests
48+
* update `sumologic/provider.go`
49+
* add the new data sources to the `DataSourcesMap`
50+
* Documentation ([preview tool](https://registry.terraform.io/tools/doc-preview))
51+
* `website/docs/d/foo.html.markdown` (singular)
52+
* purpose
53+
* example usage
54+
* detailed reference
55+
* `website/docs/d/foos.html.markdown` (plural)
56+
* purpose
57+
* example usage
58+
* detailed reference
59+
* `CHANGELOG.md`
60+
* leave the `## X.Y.Z (Unreleased)` header
61+
* a new version number will be selected only when a release is cut
62+
* add your new changes under `* Add new change notes here` (and do not delete this line)
63+
64+
If only the singular or plural versions of the data source are required, that's okay. It's not always necessary to have both.
65+
66+
### Cut a new release (Sumo Logic team members only)
67+
68+
Example PR: [link](https://github.com/SumoLogic/terraform-provider-sumologic/pull/759)
69+
70+
1. Code
71+
* `CHANGELOG.md`
72+
* Choose a new version number
73+
* Add a new line, under `* Add new change notes here`, with format `## MAJOR.MINOR.PATCH (Month Day, Year)`
74+
* Tidy up any formatting inconsistencies
75+
2. Tag the commit
76+
```bash
77+
git pull origin master
78+
git tag vX.XX.XX
79+
git push origin vX.XX.XX
80+
# where X.XX.XX is the new version of the provider
81+
```
82+
3. Wait for the goreleaser job
83+
* When you push the tag, it will trigger a GitHub Action job named `goreleaser`, which does the following automatically:
84+
* Create a draft release for the new tag
85+
* Build binaries
86+
* Attach those binaries to the draft release
87+
* You can find the job through the [Actions page](https://github.com/SumoLogic/terraform-provider-sumologic/actions)
88+
* [Example](https://github.com/SumoLogic/terraform-provider-sumologic/actions/runs/15145892343)
89+
* Wait for the job to finish (less than 10 minutes)
90+
4. Publish the release
91+
* Open the [Releases page](https://github.com/SumoLogic/terraform-provider-sumologic/releases)
92+
* Click the `Edit` button for the new draft release (at the top right, looks like a pencil)
93+
* Copy and paste the release notes from `CHANGELOG.md` into the description
94+
* Scroll all the way down and ensure `Set as the latest release` is checked
95+
* Click `Publish release`
96+
5. Verify that the release is published to the Terraform Registry
97+
* Open the [Terraform Registry](https://registry.terraform.io/providers/SumoLogic/sumologic/latest)
98+
* Check that the version number matches the new release
99+
* NOTE: This can sometimes take up to 30 minutes
100+
* If the registry still has not updated after a long time, you can redeliver the webhook messages:
101+
* Open the [Webhook settings](https://github.com/SumoLogic/terraform-provider-sumologic/settings/hooks)
102+
* For the Terraform Registry, click `Edit`
103+
* Select the `Recent Deliveries` tab
104+
* Select each of the recent messages and click `Redeliver` in order
105+
106+
## PRs from the Community
107+
108+
When a PR includes changes to the provider code, then a GitHub Action will attempt to run the acceptance tests.
109+
The acceptance tests depend on several API keys which are stored in the GitHub Secrets. For safety and security,
110+
these Secrets are not available in PRs from forked repositories. At the time of writing, our best workaround is
111+
for a Sumo Logic member to duplicate the PR.
112+
113+
1. Review the PR changes
114+
* Correctness?
115+
* Completeness?
116+
* Security risks?
117+
2. Duplicate the branch
118+
```bash
119+
gh pr checkout PR_NUMBER
120+
git checkout -b BRANCH_NAME
121+
git push origin BRANCH_NAME
122+
```
123+
3. Create a new PR ([Example](https://github.com/SumoLogic/terraform-provider-sumologic/pull/797))

sumologic/data_source_sumologic_monitor_folder.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package sumologic
22

33
import (
4-
"fmt"
4+
"fmt"
55
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
66
)
77

@@ -41,11 +41,11 @@ func dataSourceSumologicMonitorFolderRead(d *schema.ResourceData, meta interface
4141
return err
4242
}
4343

44-
if monitorsLibraryFolder == nil || monitorsLibraryFolder.ID == "" {
45-
return fmt.Errorf("folder with path '%s' does not exist", d.Get("path").(string))
46-
}
44+
if monitorsLibraryFolder == nil || monitorsLibraryFolder.ID == "" {
45+
return fmt.Errorf("folder with path '%s' does not exist", d.Get("path").(string))
46+
}
4747

48-
d.SetId(monitorsLibraryFolder.ID)
48+
d.SetId(monitorsLibraryFolder.ID)
4949
d.Set("name", monitorsLibraryFolder.Name)
5050
d.Set("description", monitorsLibraryFolder.Description)
5151

sumologic/data_source_sumologic_monitor_folder_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88
)
99

1010
func TestAccDataSourceMonitorFolder_basic(t *testing.T) {
11-
resource.Test(t, resource.TestCase{
12-
PreCheck: func() { testAccPreCheck(t) },
13-
Providers: testAccProviders,
14-
Steps: []resource.TestStep{
15-
{
16-
Config: `
11+
resource.Test(t, resource.TestCase{
12+
PreCheck: func() { testAccPreCheck(t) },
13+
Providers: testAccProviders,
14+
Steps: []resource.TestStep{
15+
{
16+
Config: `
1717
resource "sumologic_monitor_folder" "test_folder" {
1818
name = "Terraform Test"
1919
description = "Terraform Test Folder"
@@ -23,12 +23,12 @@ func TestAccDataSourceMonitorFolder_basic(t *testing.T) {
2323
depends_on = [sumologic_monitor_folder.test_folder]
2424
}
2525
`,
26-
Check: resource.ComposeTestCheckFunc(
27-
testAccDataSourceMonitorFolderCheck("data.sumologic_monitor_folder.test"),
28-
),
29-
},
30-
},
31-
})
26+
Check: resource.ComposeTestCheckFunc(
27+
testAccDataSourceMonitorFolderCheck("data.sumologic_monitor_folder.test"),
28+
),
29+
},
30+
},
31+
})
3232
}
3333

3434
func TestAccDataSourceMonitorFolder_folder_does_not_exist(t *testing.T) {
@@ -54,4 +54,4 @@ func testAccDataSourceMonitorFolderCheck(name string) resource.TestCheckFunc {
5454
resource.TestCheckResourceAttrSet(name, "id"),
5555
resource.TestCheckResourceAttrSet(name, "name"),
5656
)
57-
}
57+
}

sumologic/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func Provider() *schema.Provider {
123123
"sumologic_source_template": resourceSumologicSourceTemplate(),
124124
"sumologic_azure_metrics_source": resourceSumologicGenericPollingSource(),
125125
"sumologic_scan_budget": resourceSumologicScanBudget(),
126+
"sumologic_local_windows_event_log_source": resourceSumologicLocalWindowsEventLogSource(),
126127
},
127128
DataSourcesMap: map[string]*schema.Resource{
128129
"sumologic_cse_log_mapping_vendor_product": dataSourceCSELogMappingVendorAndProduct(),

sumologic/resource_sumologic_extraction_rule.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
// ----------------------------------------------------------------------------
2-
//
3-
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
4-
//
5-
// ----------------------------------------------------------------------------
6-
//
7-
// This file is automatically generated by Sumo Logic and manual
8-
// changes will be clobbered when the file is regenerated. Do not submit
9-
// changes to this file.
10-
//
11-
// ----------------------------------------------------------------------------\
121
package sumologic
132

143
import (

sumologic/resource_sumologic_extraction_rule_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
// ----------------------------------------------------------------------------
2-
//
3-
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
4-
//
5-
// ----------------------------------------------------------------------------
6-
//
7-
// This file is automatically generated by Sumo Logic and manual
8-
// changes will be clobbered when the file is regenerated. Do not submit
9-
// changes to this file.
10-
//
11-
// ----------------------------------------------------------------------------\
121
package sumologic
132

143
import (

0 commit comments

Comments
 (0)