Skip to content

Commit 095c403

Browse files
author
Ashish Gaurav
committed
[SLO] fix allowed value for compliance window size
Took 31 minutes
1 parent 8d98ba1 commit 095c403

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

sumologic/resource_sumologic_slo.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,25 @@ func getSLOCompliance(d *schema.ResourceData) *SLOCompliance {
520520
complianceType := complianceDict["compliance_type"].(string)
521521

522522
startFrom := ""
523-
if complianceType == "Calendar" && complianceDict["start_from"] != nil {
524-
startFrom = complianceDict["start_from"].(string)
523+
windowType := ""
524+
size := complianceDict["size"].(string)
525+
526+
if complianceType == "Calendar" {
527+
// field windowType needs to be specified instead of `size` for calendar compliance
528+
windowType = size
529+
size = ""
530+
531+
if complianceDict["start_from"] != nil {
532+
startFrom = complianceDict["start_from"].(string)
533+
}
525534
}
526535

527536
return &SLOCompliance{
528537
ComplianceType: complianceType,
529538
Target: complianceDict["target"].(float64),
530539
Timezone: complianceDict["timezone"].(string),
531-
Size: complianceDict["size"].(string),
540+
Size: size,
541+
WindowType: windowType,
532542
StartFrom: startFrom,
533543
}
534544
}

website/docs/r/slo.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The following arguments are supported:
9999
- `size` - (Required) The size of the compliance period to use.
100100
- For `Rolling` compliance type it must be a multiple of days e.g. `1d`, `2d`.
101101
- For `Calendar` compliance type the allowed values are `Week`, `Month`, `Quarter`.
102-
- `start_from` - (Optional) Start of the calendar window. For week, it would be the day of the week (for e.g Sunday,
102+
- `start_from` - Start of the calendar window. For `Week` its required and it would be the day of the week (for e.g. Sunday,
103103
Monday etc). For month, it will always be the first day of the month. For quarter, it would be the first month of
104104
the quarter (for e.g January, February etc.)
105105
- `indicator` - (Required) The service level indicator on which SLO is to be defined. more details on the difference

0 commit comments

Comments
 (0)