Skip to content

Commit 7383f8a

Browse files
authored
[T-5361] Rename resource_group_id to source_group_id (#36)
1 parent 5f016b0 commit 7383f8a

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GOLANGCI_LINT := golangci-lint run --disable-all \
88
-E staticcheck \
99
-E typecheck \
1010
-E unused
11-
VERSION := 0.5
11+
VERSION := 0.5.1
1212
.PHONY: test build
1313

1414
help:

docs/data-sources/source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ This Data Source allows you to look up existing Sources using their table name.
7979
- `ubuntu`
8080
- `vector`
8181
- `vercel_integration`
82-
- `resource_group_id` (Number) The ID of the resource group this source belongs to.
8382
- `scrape_frequency_secs` (Number) For scrape platform types, how often to scrape the URLs.
8483
- `scrape_request_basic_auth_password` (String, Sensitive) Basic auth password for scraping.
8584
- `scrape_request_basic_auth_user` (String) Basic auth username for scraping.
8685
- `scrape_request_headers` (List of Map of String) An array of request headers, each containing `name` and `value` fields.
8786
- `scrape_urls` (List of String) For scrape platform types, the set of urls to scrape.
87+
- `source_group_id` (Number) The ID of the source group this source belongs to.
8888
- `team_name` (String) Used to specify the team the resource should be created in when using global tokens.
8989
- `token` (String) The token of this source. This token is used to identify and route the data you will send to Better Stack.
9090
- `updated_at` (String) The time when this monitor group was updated.

docs/resources/source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ This resource allows you to create, modify, and delete your Sources. For more in
7575
- `live_tail_pattern` (String) Freeform text template for formatting Live tail output with columns wrapped in {column} brackets. Example: "PID: {message_json.pid} {level} {message}"
7676
- `logs_retention` (Number) Data retention for logs in days. There might be additional charges for longer retention.
7777
- `metrics_retention` (Number) Data retention for metrics in days. There might be additional charges for longer retention.
78-
- `resource_group_id` (Number) The ID of the resource group this source belongs to.
7978
- `scrape_frequency_secs` (Number) For scrape platform types, how often to scrape the URLs.
8079
- `scrape_request_basic_auth_password` (String, Sensitive) Basic auth password for scraping.
8180
- `scrape_request_basic_auth_user` (String) Basic auth username for scraping.
8281
- `scrape_request_headers` (List of Map of String) An array of request headers, each containing `name` and `value` fields.
8382
- `scrape_urls` (List of String) For scrape platform types, the set of urls to scrape.
83+
- `source_group_id` (Number) The ID of the source group this source belongs to.
8484
- `team_name` (String) Used to specify the team the resource should be created in when using global tokens.
8585

8686
### Read-Only

internal/provider/resource_source.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ var sourceSchema = map[string]*schema.Schema{
203203
Optional: true,
204204
Computed: true,
205205
},
206-
"resource_group_id": {
207-
Description: "The ID of the resource group this source belongs to.",
206+
"source_group_id": {
207+
Description: "The ID of the source group this source belongs to.",
208208
Type: schema.TypeInt,
209209
Optional: true,
210210
},
@@ -244,7 +244,7 @@ type source struct {
244244
ScrapeRequestBasicAuthUser *string `json:"scrape_request_basic_auth_user,omitempty"`
245245
ScrapeRequestBasicAuthPassword *string `json:"scrape_request_basic_auth_password,omitempty"`
246246
DataRegion *string `json:"data_region,omitempty"`
247-
ResourceGroupID *int `json:"resource_group_id,omitempty"`
247+
SourceGroupID *int `json:"source_group_id,omitempty"`
248248
}
249249

250250
type sourceHTTPResponse struct {
@@ -279,7 +279,7 @@ func sourceRef(in *source) []struct {
279279
{k: "scrape_request_basic_auth_user", v: &in.ScrapeRequestBasicAuthUser},
280280
{k: "scrape_request_basic_auth_password", v: &in.ScrapeRequestBasicAuthPassword},
281281
{k: "data_region", v: &in.DataRegion},
282-
{k: "resource_group_id", v: &in.ResourceGroupID},
282+
{k: "source_group_id", v: &in.SourceGroupID},
283283
}
284284
}
285285

internal/provider/resource_source_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func TestResourceSource(t *testing.T) {
9393
name = "%s"
9494
platform = "%s"
9595
data_region = "eu-hel-1-legacy"
96-
resource_group_id = 123
96+
source_group_id = 123
9797
}
9898
`, name, platform),
9999
Check: resource.ComposeTestCheckFunc(
@@ -103,7 +103,7 @@ func TestResourceSource(t *testing.T) {
103103
resource.TestCheckResourceAttr("logtail_source.this", "token", "generated_by_logtail"),
104104
resource.TestCheckResourceAttr("logtail_source.this", "ingesting_host", "in.logs.betterstack.com"),
105105
resource.TestCheckResourceAttr("logtail_source.this", "data_region", "eu-hel-1-legacy"),
106-
resource.TestCheckResourceAttr("logtail_source.this", "resource_group_id", "123"),
106+
resource.TestCheckResourceAttr("logtail_source.this", "source_group_id", "123"),
107107
),
108108
},
109109
// Step 2 - update.
@@ -120,7 +120,7 @@ func TestResourceSource(t *testing.T) {
120120
metrics_retention = 60
121121
live_tail_pattern = "{level} {message}"
122122
ingesting_paused = true
123-
resource_group_id = 456
123+
source_group_id = 456
124124
}
125125
`, name, platform),
126126
Check: resource.ComposeTestCheckFunc(
@@ -131,7 +131,7 @@ func TestResourceSource(t *testing.T) {
131131
resource.TestCheckResourceAttr("logtail_source.this", "token", "generated_by_logtail"),
132132
resource.TestCheckResourceAttr("logtail_source.this", "ingesting_host", "in.logs.betterstack.com"),
133133
resource.TestCheckResourceAttr("logtail_source.this", "data_region", "eu-hel-1-legacy"),
134-
resource.TestCheckResourceAttr("logtail_source.this", "resource_group_id", "456"),
134+
resource.TestCheckResourceAttr("logtail_source.this", "source_group_id", "456"),
135135
),
136136
},
137137
// Step 3 - make no changes, check plan is empty (omitted attributes are not controlled)
@@ -144,7 +144,7 @@ func TestResourceSource(t *testing.T) {
144144
resource "logtail_source" "this" {
145145
name = "%s"
146146
platform = "%s"
147-
resource_group_id = 456
147+
source_group_id = 456
148148
}
149149
`, name, platform),
150150
PlanOnly: true,

0 commit comments

Comments
 (0)