Skip to content

Commit a669377

Browse files
Merge pull request #692 from SumoLogic/rs-make-tier-lowercase
Fix analytics_tier case sensitivity in resource_sumologic_partition
2 parents e8caa8b + a8581ee commit a669377

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENHANCEMENTS:
77
* Added *index_id* attribute to sumologic_scheduled_view. (GH-691)
88
* Added support for configuring sumologic_data_forwarding_rule for sumologic_scheduled_view. (GH-691)
99
BUG FIXES:
10+
* Fix analytics_tier case sensitivity in resource_sumologic_partition (GH-692)
1011
* Remove regex match in resource_sumologic_log_search (GH-693)
1112

1213
## 2.31.4 (September 19, 2024)
@@ -22,7 +23,7 @@ ENHANCEMENTS:
2223
* Add IsIncludedInDefaultSearch field to partition resource (GH-674)
2324

2425
BUG FIXES:
25-
* Fix cse_log_mappings resource conversion affecting import (GH-675)
26+
* Fix cse_log_mappings resource conversion affecting import (GH-675)
2627

2728
## 2.31.1 (July 2, 2024)
2829
BUG FIXES:

sumologic/resource_sumologic_partition.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sumologic
22

33
import (
44
"log"
5+
"strings"
56

67
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
78
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
@@ -32,6 +33,12 @@ func resourceSumologicPartition() *schema.Resource {
3233
"analytics_tier": {
3334
Type: schema.TypeString,
3435
Optional: true,
36+
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
37+
if strings.ToLower(old) == strings.ToLower(new) {
38+
return true
39+
}
40+
return false
41+
},
3542
},
3643
"retention_period": {
3744
Type: schema.TypeInt,
@@ -142,7 +149,7 @@ func resourceSumologicPartitionUpdate(d *schema.ResourceData, meta interface{})
142149

143150
func resourceToPartition(d *schema.ResourceData) Partition {
144151

145-
analyticsTier := d.Get("analytics_tier").(string)
152+
analyticsTier := strings.ToLower(d.Get("analytics_tier").(string))
146153
isIncludedInDefaultSearch := d.Get("is_included_in_default_search").(bool)
147154

148155
var isIncludedInDefaultSearchPtr *bool

0 commit comments

Comments
 (0)