Skip to content

Commit a96ceda

Browse files
author
Pedro Montiel
committed
INVS-11: remove active flag
1 parent 0d7488c commit a96ceda

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

sumologic/resource_sumologic_cse_match_list.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ func resourceSumologicCSEMatchList() *schema.Resource {
1717
},
1818

1919
Schema: map[string]*schema.Schema{
20-
"active": {
21-
Type: schema.TypeBool,
22-
Optional: true,
23-
},
2420
"default_ttl": {
2521
Type: schema.TypeInt,
2622
Required: true,
@@ -66,10 +62,6 @@ func resourceSumologicCSEMatchList() *schema.Resource {
6662
Type: schema.TypeString,
6763
Computed: true,
6864
},
69-
"active": {
70-
Type: schema.TypeBool,
71-
Required: true,
72-
},
7365
"description": {
7466
Type: schema.TypeString,
7567
Required: true,
@@ -143,7 +135,6 @@ func setItems(d *schema.ResourceData, items []CSEMatchListItemGet) {
143135
for _, t := range items {
144136
mapping := map[string]interface{}{
145137
"id": t.ID,
146-
"active": t.Active,
147138
"description": t.Meta.Description,
148139
"expiration": t.Expiration,
149140
"value": t.Value,
@@ -184,7 +175,7 @@ func resourceSumologicCSEMatchListCreate(d *schema.ResourceData, meta interface{
184175

185176
if d.Id() == "" {
186177
id, err := c.CreateCSEMatchList(CSEMatchListPost{
187-
Active: d.Get("active").(bool),
178+
Active: true,
188179
DefaultTtl: d.Get("default_ttl").(int),
189180
Description: d.Get("description").(string),
190181
Name: d.Get("name").(string),
@@ -227,7 +218,7 @@ func resourceToCSEMatchListItem(data interface{}) CSEMatchListItemPost {
227218
itemObj := itemsSlice[0].(map[string]interface{})
228219
item.ID = itemObj["id"].(string)
229220
item.Description = itemObj["description"].(string)
230-
item.Active = itemObj["active"].(bool)
221+
item.Active = true
231222
item.Expiration = itemObj["expiration"].(string)
232223
item.Value = itemObj["value"].(string)
233224
}
@@ -284,7 +275,7 @@ func resourceToCSEMatchList(d *schema.ResourceData) (CSEMatchListPost, error) {
284275

285276
return CSEMatchListPost{
286277
ID: id,
287-
Active: d.Get("active").(bool),
278+
Active: true,
288279
DefaultTtl: d.Get("default_ttl").(int),
289280
Description: d.Get("description").(string),
290281
Name: d.Get("name").(string),

sumologic/resource_sumologic_cse_match_list_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ func TestAccSumologicSCEMatchList_createAndUpdate(t *testing.T) {
1212
SkipCseTest(t)
1313

1414
var matchList CSEMatchListGet
15-
nActive := true
1615
nDefaultTtl := 10800
1716
nDescription := "New Match List Description"
1817
nName := "Match List Name"
1918
nTargetColumn := "SrcIp"
20-
liActive := true
2119
liDescription := "Match List Item Description"
2220
liValue := "value"
2321
liExpiration := "2122-02-27T04:00:00"
@@ -32,15 +30,15 @@ func TestAccSumologicSCEMatchList_createAndUpdate(t *testing.T) {
3230
CheckDestroy: testAccCSEMatchListDestroy,
3331
Steps: []resource.TestStep{
3432
{
35-
Config: testCreateCSEMatchListConfig(nActive, nDefaultTtl, nDescription, nName, nTargetColumn, liActive, liDescription, liExpiration, liValue),
33+
Config: testCreateCSEMatchListConfig(nDefaultTtl, nDescription, nName, nTargetColumn, liDescription, liExpiration, liValue),
3634
Check: resource.ComposeTestCheckFunc(
3735
testCheckCSEMatchListExists(resourceName, &matchList),
3836
testCheckMatchListValues(&matchList, nDefaultTtl, nDescription, nName, nTargetColumn),
3937
resource.TestCheckResourceAttrSet(resourceName, "id"),
4038
),
4139
},
4240
{
43-
Config: testCreateCSEMatchListConfig(nActive, uDefaultTtl, uDescription, nName, nTargetColumn, liActive, uliDescription, liExpiration, liValue),
41+
Config: testCreateCSEMatchListConfig(uDefaultTtl, uDescription, nName, nTargetColumn, uliDescription, liExpiration, liValue),
4442
Check: resource.ComposeTestCheckFunc(
4543
testCheckCSEMatchListExists(resourceName, &matchList),
4644
testCheckMatchListValues(&matchList, uDefaultTtl, uDescription, nName, nTargetColumn),
@@ -73,22 +71,20 @@ func testAccCSEMatchListDestroy(s *terraform.State) error {
7371
return nil
7472
}
7573

76-
func testCreateCSEMatchListConfig(nActive bool, nDefaultTtl int, nDescription string, nName string, nTargetColumn string, liActive bool, liDescription string, liExpiration string, liValue string) string {
74+
func testCreateCSEMatchListConfig(nDefaultTtl int, nDescription string, nName string, nTargetColumn string, liDescription string, liExpiration string, liValue string) string {
7775
return fmt.Sprintf(`
7876
resource "sumologic_cse_match_list" "match_list" {
79-
active = "%t"
8077
default_ttl = "%d"
8178
description = "%s"
8279
name = "%s"
8380
target_column = "%s"
8481
items {
85-
active = "%t"
8682
description = "%s"
8783
expiration = "%s"
8884
value = "%s"
8985
}
9086
}
91-
`, nActive, nDefaultTtl, nDescription, nName, nTargetColumn, liActive, liDescription, liExpiration, liValue)
87+
`, nDefaultTtl, nDescription, nName, nTargetColumn, liDescription, liExpiration, liValue)
9288
}
9389

9490
func testCheckCSEMatchListExists(n string, matchList *CSEMatchListGet) resource.TestCheckFunc {

website/docs/r/cse_log_match_list.html.markdown

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ resource "sumologic_cse_match_list" "match_list" {
2929

3030
The following arguments are supported:
3131

32-
- `active` - (Optional) Match list active flag. Default True.
3332
- `default_ttl` - (Required) The match list time to live. Specified in seconds.
3433
- `description` - (Required) Match list description.
3534
- `name` - (Required) Match list name.
3635
- `target_column` - (Required) Target column. (possible values: Hostname, FileHash, Url, SrcIp, DstIp, Domain, Username, Ip, Asn, Isp, Org, SrcAsn, SrcIsp, SrcOrg, DstAsn, DstIsp, DstOrg or any custom column.)
3736
- `items` - (Optional) List of match list items. See [match_list_item schema](#schema-for-match_list_item) for details.
3837

3938
### Schema for `match_list_item`
40-
- `acive` - (Required) Match list item active flag.
4139
- `description` - (Required) Match list item description.
4240
- `value` - (Optional) Match list item value.
4341
- `expiration` - (Optional) Match list item expiration. (Format: YYYY-MM-DDTHH:mm:ss)

0 commit comments

Comments
 (0)