Skip to content

Commit 0140fae

Browse files
Mark num_finite_buckets required for cloud logging metric bucket_options (#8780) (#15680)
Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Cameron Thornton <[email protected]>
1 parent 370899e commit 0140fae

File tree

3 files changed

+27
-30
lines changed

3 files changed

+27
-30
lines changed

.changelog/8780.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:breaking-change
2+
logging: made `growth_factor`, `num_finite_buckets`, and `scale` required for `google_logging_metric`
3+
```

google/services/logging/resource_logging_metric.go

+18-24
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,19 @@ the lower bound. Each bucket represents a constant relative uncertainty on a spe
105105
Elem: &schema.Resource{
106106
Schema: map[string]*schema.Schema{
107107
"growth_factor": {
108-
Type: schema.TypeFloat,
109-
Optional: true,
110-
Description: `Must be greater than 1.`,
111-
AtLeastOneOf: []string{"bucket_options.0.exponential_buckets.0.num_finite_buckets", "bucket_options.0.exponential_buckets.0.growth_factor", "bucket_options.0.exponential_buckets.0.scale"},
108+
Type: schema.TypeFloat,
109+
Required: true,
110+
Description: `Must be greater than 1.`,
112111
},
113112
"num_finite_buckets": {
114-
Type: schema.TypeInt,
115-
Optional: true,
116-
Description: `Must be greater than 0.`,
117-
AtLeastOneOf: []string{"bucket_options.0.exponential_buckets.0.num_finite_buckets", "bucket_options.0.exponential_buckets.0.growth_factor", "bucket_options.0.exponential_buckets.0.scale"},
113+
Type: schema.TypeInt,
114+
Required: true,
115+
Description: `Must be greater than 0.`,
118116
},
119117
"scale": {
120-
Type: schema.TypeFloat,
121-
Optional: true,
122-
Description: `Must be greater than 0.`,
123-
AtLeastOneOf: []string{"bucket_options.0.exponential_buckets.0.num_finite_buckets", "bucket_options.0.exponential_buckets.0.growth_factor", "bucket_options.0.exponential_buckets.0.scale"},
118+
Type: schema.TypeFloat,
119+
Required: true,
120+
Description: `Must be greater than 0.`,
124121
},
125122
},
126123
},
@@ -135,22 +132,19 @@ Each bucket represents a constant absolute uncertainty on the specific value in
135132
Elem: &schema.Resource{
136133
Schema: map[string]*schema.Schema{
137134
"num_finite_buckets": {
138-
Type: schema.TypeInt,
139-
Optional: true,
140-
Description: `Must be greater than 0.`,
141-
AtLeastOneOf: []string{"bucket_options.0.linear_buckets.0.num_finite_buckets", "bucket_options.0.linear_buckets.0.width", "bucket_options.0.linear_buckets.0.offset"},
135+
Type: schema.TypeInt,
136+
Required: true,
137+
Description: `Must be greater than 0.`,
142138
},
143139
"offset": {
144-
Type: schema.TypeFloat,
145-
Optional: true,
146-
Description: `Lower bound of the first bucket.`,
147-
AtLeastOneOf: []string{"bucket_options.0.linear_buckets.0.num_finite_buckets", "bucket_options.0.linear_buckets.0.width", "bucket_options.0.linear_buckets.0.offset"},
140+
Type: schema.TypeFloat,
141+
Required: true,
142+
Description: `Lower bound of the first bucket.`,
148143
},
149144
"width": {
150-
Type: schema.TypeFloat,
151-
Optional: true,
152-
Description: `Must be greater than 0.`,
153-
AtLeastOneOf: []string{"bucket_options.0.linear_buckets.0.num_finite_buckets", "bucket_options.0.linear_buckets.0.width", "bucket_options.0.linear_buckets.0.offset"},
145+
Type: schema.TypeFloat,
146+
Required: true,
147+
Description: `Must be greater than 0.`,
154148
},
155149
},
156150
},

website/docs/r/logging_metric.html.markdown

+6-6
Original file line numberDiff line numberDiff line change
@@ -300,29 +300,29 @@ The following arguments are supported:
300300
<a name="nested_linear_buckets"></a>The `linear_buckets` block supports:
301301

302302
* `num_finite_buckets` -
303-
(Optional)
303+
(Required)
304304
Must be greater than 0.
305305

306306
* `width` -
307-
(Optional)
307+
(Required)
308308
Must be greater than 0.
309309

310310
* `offset` -
311-
(Optional)
311+
(Required)
312312
Lower bound of the first bucket.
313313

314314
<a name="nested_exponential_buckets"></a>The `exponential_buckets` block supports:
315315

316316
* `num_finite_buckets` -
317-
(Optional)
317+
(Required)
318318
Must be greater than 0.
319319

320320
* `growth_factor` -
321-
(Optional)
321+
(Required)
322322
Must be greater than 1.
323323

324324
* `scale` -
325-
(Optional)
325+
(Required)
326326
Must be greater than 0.
327327

328328
<a name="nested_explicit_buckets"></a>The `explicit_buckets` block supports:

0 commit comments

Comments
 (0)