Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23,000 changes: 15,644 additions & 7,356 deletions generated/kbapi/kibana.gen.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions generated/kbapi/transform_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ func transformFilterPaths(schema *Schema) {
"/api/maintenance_window/{id}": {"delete", "get", "patch"},
"/api/actions/connector/{id}": {"get", "put", "post", "delete"},
"/api/actions/connectors": {"get"},
"/api/detection_engine/rules": {"get", "put", "post", "delete"},
}

for path, pathInfo := range schema.Paths {
Expand Down
45 changes: 45 additions & 0 deletions internal/kibana/security/detection_rule/acc_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package detection_rule_test

import (
"testing"

"github.com/elastic/terraform-provider-elasticstack/internal/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccResourceDetectionRule_basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ProtoV6ProviderFactories: acctest.Providers,
Steps: []resource.TestStep{
{
Config: testAccResourceDetectionRule_basic,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("elasticstack_kibana_security_detection_rule.test", "name", "Test Detection Rule"),
resource.TestCheckResourceAttr("elasticstack_kibana_security_detection_rule.test", "description", "A test detection rule"),
resource.TestCheckResourceAttr("elasticstack_kibana_security_detection_rule.test", "type", "query"),
resource.TestCheckResourceAttr("elasticstack_kibana_security_detection_rule.test", "severity", "medium"),
resource.TestCheckResourceAttr("elasticstack_kibana_security_detection_rule.test", "risk_score", "50"),
resource.TestCheckResourceAttr("elasticstack_kibana_security_detection_rule.test", "enabled", "true"),
resource.TestCheckResourceAttrSet("elasticstack_kibana_security_detection_rule.test", "id"),
resource.TestCheckResourceAttrSet("elasticstack_kibana_security_detection_rule.test", "rule_id"),
),
},
},
})
}

const testAccResourceDetectionRule_basic = `
resource "elasticstack_kibana_security_detection_rule" "test" {
name = "Test Detection Rule"
description = "A test detection rule"
type = "query"
severity = "medium"
risk_score = 50
enabled = true
query = "user.name:*"
language = "kuery"

tags = ["test", "terraform"]
}
`
Loading
Loading