Skip to content

Commit 4951d54

Browse files
committed
SUMO-251562 Merging master and removing auto-generated comments
2 parents 3d03a07 + d524e11 commit 4951d54

Some content is hidden

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

41 files changed

+2194
-197
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in
5-
# the repo. Unless a later match takes precedence,
6-
# @sumovishal, @dagould will be requested for
7-
# review when someone opens a pull request.
8-
* @sumovishal @dagould
5+
# the repo. Unless a later match takes precedence, they will
6+
# be requested for review when someone opens a pull request.
7+
* @SumoLogic/tf-platform-team
98

109
# Code owners for collection sources
1110
/sumologic/*_source.go @maimaisie @vsinghal13
1211
/sumologic/*_source_test.go @maimaisie @vsinghal13
1312
/sumologic/*_ingest_budget* @maimaisie @vsinghal13
1413
/sumologic/*_collector* @maimaisie @vsinghal13
15-
/sumologic/*_cse* @josh-williams @pmontiel-sumo
14+
/sumologic/*_cse* @pmontiel-sumo
1615
/website/docs/r/collector* @maimaisie @vsinghal13
1716
/website/docs/r/ingest_* @maimaisie @vsinghal13
1817
/website/docs/r/*_source* @maimaisie @vsinghal13

.github/workflows/pr-checks.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
changelog-check:
9+
name: Check CHANGELOG.md
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 2
16+
17+
- name: Check for CHANGELOG.md edits and comment if missing
18+
run: |
19+
if ! git diff --name-only HEAD^1 HEAD | grep -q 'CHANGELOG.md'; then
20+
gh pr comment ${{ github.event.pull_request.number }} --body "⚠️ Warning: Please update CHANGELOG.md with your changes."
21+
fi
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ jobs:
101101
SUMOLOGIC_DATA_FORWARDING_BUCKET: ${{ secrets.SUMOLOGIC_DATA_FORWARDING_BUCKET }}
102102
SUMOLOGIC_DATA_FORWARDING_ROLE_ARN: ${{ secrets.SUMOLOGIC_DATA_FORWARDING_ROLE_ARN }}
103103
SUMOLOGIC_DATA_FORWARDING_AWS_REGION: ${{ secrets.SUMOLOGIC_DATA_FORWARDING_AWS_REGION }}
104+
SUMOLOGIC_TEST_AZURE_TENANT_ID: ${{ secrets.SUMOLOGIC_TEST_AZURE_TENANT_ID }}
105+
SUMOLOGIC_TEST_AZURE_CLIENT_ID: ${{ secrets.SUMOLOGIC_TEST_AZURE_CLIENT_ID }}
106+
SUMOLOGIC_TEST_AZURE_CLIENT_SECRET: ${{ secrets.SUMOLOGIC_TEST_AZURE_CLIENT_SECRET }}
104107

105108
# disable go test timeout. We rely on GitHub action timeout.
106109
run: |

CHANGELOG.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,54 @@ FEATURES:
44
* **New Resource:** sumologic_source_template (GH-708)
55
* **New Resource:** sumologic_ot_collector (GH-708)
66

7+
MAINTENANCE:
8+
* If a PR author forgets to update this change log, then a comment will be automatically added to the PR to remind them
9+
10+
## 3.0.6 (March 10, 2025)
11+
12+
FEATURES:
13+
* Add support for CSE strict custom insights
14+
15+
## 3.0.5 (March 3, 2025)
16+
17+
ENHANCEMENTS:
18+
* Add support for monitor frequency configurability
19+
20+
BUG FIXES:
21+
* Polling source paths without `use_versioned_api` will not show an incorrect diff in the `terraform plan`
22+
23+
## 3.0.4 (February 4, 2025)
24+
BUG FIXES:
25+
* Fixed issue with release artifacts
26+
27+
## 3.0.3 (January 31, 2025)
28+
FEATURES:
29+
* **New Resource:** sumologic_metrics_search_v2
30+
31+
## 3.0.2 (January 29, 2025)
32+
FEATURES:
33+
* **New Resource:** sumologic_scan_budget
34+
35+
## 3.0.1 (January 17, 2025)
36+
ENHANCEMENTS:
37+
* Add support for update method to change state of the fields resource
38+
739
## 3.0.0 (December 09, 2024)
8-
**REMOVALS:**
40+
REMOVALS:
941
* resource_sumologic_ingest_budget : remove deprecated resource.
1042
* resource_sumologic_collector_ingest_budget_assignment: remove deprecated resource.
1143

12-
**ENHANCEMENTS:**
44+
ENHANCEMENTS:
1345
* Add support for MetricsAnomalyCondition to Monitor resource (GH-698)
1446

15-
**BUG FIXES:**
47+
BUG FIXES:
1648
* Fixed typo in connection.html.markdown documentation
1749

1850
## 2.31.5 (October 04, 2024)
1951
ENHANCEMENTS:
2052
* Added *index_id* attribute to sumologic_scheduled_view. (GH-691)
2153
* Added support for configuring sumologic_data_forwarding_rule for sumologic_scheduled_view. (GH-691)
54+
2255
BUG FIXES:
2356
* Fix analytics_tier case sensitivity in resource_sumologic_partition (GH-692)
2457
* Remove regex match in resource_sumologic_log_search (GH-693)

README.md

Lines changed: 64 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,64 +12,90 @@ The Terraform Sumo Logic provider is a plugin for Terraform that allows for the
1212

1313
This provider is maintained by Sumo Logic.
1414

15+
## Prerequisites
16+
17+
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13
18+
- [Go](https://golang.org/doc/install) >= 1.13 (to build the provider plugin)
19+
- Set [`$GOPATH`](http://golang.org/doc/code.html#GOPATH)
20+
- Add `$GOPATH/bin` to your `$PATH`
21+
- [Sumo Logic](https://www.sumologic.com/)
22+
1523
## Getting started
1624

17-
[Using the provider](https://www.terraform.io/docs/providers/sumologic/)
25+
Add the Sumo Logic provider to your terraform configuration:
1826

19-
Run `terraform init` to automatically install the latest version of the provider.
27+
```
28+
terraform {
29+
required_providers {
30+
sumologic = {
31+
source = "sumologic/sumologic"
32+
version = "" # set the Sumo Logic Terraform Provider version
33+
}
34+
}
35+
}
36+
```
2037

21-
Requirements
22-
------------
38+
Run `terraform init` to automatically install the selected version of the provider.
2339

24-
- [Terraform](https://www.terraform.io/downloads.html) 0.12.x, 0.13x, or 0.14x
25-
- [Go](https://golang.org/doc/install) >= 1.13 (to build the provider plugin)
26-
- [Sumo Logic](https://www.sumologic.com/)
40+
See the [provider documentation](https://www.terraform.io/docs/providers/sumologic/) for information on the supported resources and example usage.
2741

2842
## Developing the provider
2943

30-
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine. You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
31-
32-
Clone repository to: `$GOPATH/src/SumoLogic/sumologic-terraform-provider`
44+
### Build from source
3345

3446
```sh
35-
$ mkdir -p $GOPATH/src/SumoLogic;
36-
$ cd $GOPATH/src/SumoLogic
3747
$ git clone https://github.com/SumoLogic/terraform-provider-sumologic.git
48+
$ cd terraform-provider-sumologic
49+
$ make build
3850
```
3951

40-
Enter the provider directory and build the provider. To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
52+
This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
53+
54+
### Run locally-built provider
55+
56+
- Run `make install-dev`
57+
- Update the provider source in your configuration file:
4158

42-
```sh
43-
$ cd $GOPATH/src/SumoLogic/terraform-provider-sumologic
44-
$ make build
4559
```
60+
terraform {
61+
required_providers {
62+
sumologic = {
63+
source = "sumologic.com/dev/sumologic"
64+
version = "~> 1.0.0"
65+
}
66+
}
67+
}
68+
```
69+
70+
## Acceptance tests
4671

47-
## Testing the provider
72+
> **Note:** Acceptance tests create real resources, and often cost money to run.
4873
49-
In order to test the provider, you can run `make test`.
74+
### Configuration
5075

51-
For manual testing, run `make install` in the root directory to install it as a plugin.
52-
Then run `terraform init` to initialize it.
76+
Create a personal access key for your Sumo Logic account, and set the following environment variables.
5377

54-
In order to run the full suite of Acceptance tests, run `make testacc`.
78+
```sh
79+
$ export SUMOLOGIC_ACCESSID="yourAccessID"
80+
$ export SUMOLOGIC_ACCESSKEY="yourAccessKey"
81+
$ export SUMOLOGIC_ENVIRONMENT="yourEnvironment"
82+
$ export SUMOLOGIC_BASE_URL="yourEnvironmentAPIUrl" # not required for most production deployments
83+
$ export TF_ACC=1
84+
```
85+
86+
More information on configuration can be found [here](https://github.com/SumoLogic/terraform-provider-sumologic/blob/master/website/docs/index.html.markdown#environment-variables).
5587

56-
To run a specific acceptance test, run `go test -v ./sumologic -run YourSpecificTestName`
88+
### Run the tests
5789

58-
*Note:*
59-
- Acceptance tests *create real resources*, and often cost money to run. The environment variables `SUMOLOGIC_ACCESSID`, `SUMOLOGIC_ACCESSKEY`, `SUMOLOGIC_ENVIRONMENT` / `SUMOLOGIC_BASE_URL`, and `TF_ACC` must also be set for acceptance tests to work properly. You can generate a personal access key from your environment. Once your test runs, you are then capable of viewing the real resources created by Terraform in the UI.
60-
```sh
61-
$ export SUMOLOGIC_ACCESSID="yourAccessID"
62-
$ export SUMOLOGIC_ACCESSKEY="yourAccessKey"
63-
$ export SUMOLOGIC_ENVIRONMENT="yourEnvironment"
64-
$ export SUMOLOGIC_BASE_URL="yourEnvironmentAPIUrl"
65-
$ export TF_ACC=1
66-
```
67-
- More information on configuration can be found [here](https://github.com/SumoLogic/terraform-provider-sumologic/blob/master/website/docs/index.html.markdown#environment-variables).
90+
```sh
91+
# Run all acceptance tests:
92+
$ make testacc
93+
# Run a specific test:
94+
$ go test -v ./sumologic -run YourSpecificTestName
95+
```
6896

69-
- Environment variable `SUMOLOGIC_TEST_GOOGLE_APPLICATION_CREDENTIALS` must be set for gcp metrics acceptance tests to work properly (ex. below).
70-
- export SUMOLOGIC_TEST_GOOGLE_APPLICATION_CREDENTIALS=`cat /path/to/service_acccount.json`
71-
- Set Environment variable `SUMOLOGIC_ENABLE_GCP_METRICS_ACC_TESTS` to false, to disable acceptance test for Gcp Metrics.
97+
Some tests require additional configuration for interacting with resources external to Sumo Logic:
7298

73-
[0]: https://help.sumologic.com/Manage/Security/Access-Keys
74-
[1]: https://help.sumologic.com/APIs/General_API_Information/Sumo_Logic_Endpoints_and_Firewall_Security
75-
[10]: https://www.terraform.io/docs/providers/sumologic/
99+
- GCP metrics
100+
- `export SUMOLOGIC_TEST_GOOGLE_APPLICATION_CREDENTIALS=$(cat /path/to/service_acccount.json)`
101+
- `export SUMOLOGIC_ENABLE_GCP_METRICS_ACC_TESTS="false"` to disable acceptance tests

sumologic/provider.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,14 @@ func Provider() terraform.ResourceProvider {
116116
"sumologic_local_file_source": resourceSumologicLocalFileSource(),
117117
"sumologic_log_search": resourceSumologicLogSearch(),
118118
"sumologic_metrics_search": resourceSumologicMetricsSearch(),
119+
"sumologic_metrics_search_v2": resourceSumologicMetricsSearchV2(),
119120
"sumologic_rum_source": resourceSumologicRumSource(),
120121
"sumologic_role_v2": resourceSumologicRoleV2(),
121122
"sumologic_azure_event_hub_log_source": resourceSumologicGenericPollingSource(),
122123
"sumologic_ot_collector": resourceSumologicOTCollector(),
123124
"sumologic_source_template": resourceSumologicSourceTemplate(),
125+
"sumologic_azure_metrics_source": resourceSumologicGenericPollingSource(),
126+
"sumologic_scan_budget": resourceSumologicScanBudget(),
124127
},
125128
DataSourcesMap: map[string]*schema.Resource{
126129
"sumologic_cse_log_mapping_vendor_product": dataSourceCSELogMappingVendorAndProduct(),

sumologic/resource_sumologic_azure_event_hub_log_source_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ func TestAccSumologicAzureEventHubLogSource_create(t *testing.T) {
4141
resource.TestCheckResourceAttr(azureEventHubLogResourceName, "content_type", "AzureEventHubLog"),
4242
resource.TestCheckResourceAttr(azureEventHubLogResourceName, "path.0.type", "AzureEventHubPath"),
4343
),
44-
ExpectNonEmptyPlan: true,
4544
},
4645
},
4746
})
@@ -75,7 +74,6 @@ func TestAccSumologicAzureEventHubLogSource_update(t *testing.T) {
7574
resource.TestCheckResourceAttr(azureEventHubLogResourceName, "content_type", "AzureEventHubLog"),
7675
resource.TestCheckResourceAttr(azureEventHubLogResourceName, "path.0.type", "AzureEventHubPath"),
7776
),
78-
ExpectNonEmptyPlan: true,
7977
},
8078
{
8179
Config: testAccSumologicAzureEventHubLogSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testSASKeyName, testSASKey, testNamespace, testEventHub, testConsumerGroup, testRegion),
@@ -89,7 +87,6 @@ func TestAccSumologicAzureEventHubLogSource_update(t *testing.T) {
8987
resource.TestCheckResourceAttr(azureEventHubLogResourceName, "content_type", "AzureEventHubLog"),
9088
resource.TestCheckResourceAttr(azureEventHubLogResourceName, "path.0.type", "AzureEventHubPath"),
9189
),
92-
ExpectNonEmptyPlan: true,
9390
},
9491
},
9592
})

0 commit comments

Comments
 (0)