Skip to content
Merged
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
451 changes: 136 additions & 315 deletions internal/kibana/connectors/acc_test.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variable "connector_name" {
description = "The connector name"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = var.connector_name
config = jsonencode({
apiUrl = "https://bedrock-runtime.us-east-1.amazonaws.com"
defaultModel = "anthropic.claude-v2"
})
secrets = jsonencode({
accessKey = "test-access-key"
secret = "test-secret-key"
})
connector_type_id = ".bedrock"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variable "connector_name" {
description = "The connector name"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = "Updated ${var.connector_name}"
config = jsonencode({
apiUrl = "https://bedrock-runtime.us-west-2.amazonaws.com"
defaultModel = "anthropic.claude-3-5-sonnet-20240620-v1:0"
})
secrets = jsonencode({
accessKey = "updated-access-key"
secret = "updated-secret-key"
})
connector_type_id = ".bedrock"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variable "connector_name" {
description = "The connector name"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = var.connector_name
config = jsonencode({
apiProvider = "OpenAI"
apiUrl = "https://api.openai.com/v1"
defaultModel = "gpt-4"
})
secrets = jsonencode({
apiKey = "test-api-key"
})
connector_type_id = ".gen-ai"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variable "connector_name" {
description = "The connector name"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = "Updated ${var.connector_name}"
config = jsonencode({
apiProvider = "OpenAI"
apiUrl = "https://api.openai.com/v1"
defaultModel = "gpt-4o"
})
secrets = jsonencode({
apiKey = "updated-api-key"
})
connector_type_id = ".gen-ai"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
variable "connector_name" {
description = "The connector name"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = var.connector_name
config = jsonencode({
createIncidentJson = "{}"
createIncidentResponseKey = "key"
createIncidentUrl = "https://www.elastic.co/"
getIncidentResponseExternalTitleKey = "title"
getIncidentUrl = "https://www.elastic.co/"
updateIncidentJson = "{}"
updateIncidentUrl = "https://www.elastic.co/"
viewIncidentUrl = "https://www.elastic.co/"
})
secrets = jsonencode({
user = "user1"
password = "password1"
})
connector_type_id = ".cases-webhook"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "connector_name" {
description = "The connector name"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = "Updated ${var.connector_name}"
config = jsonencode({
createIncidentJson = "{}"
createIncidentResponseKey = "key"
createIncidentUrl = "https://www.elastic.co/"
getIncidentResponseExternalTitleKey = "title"
getIncidentUrl = "https://www.elastic.co/"
updateIncidentJson = "{}"
updateIncidentUrl = "https://elasticsearch.com/"
viewIncidentUrl = "https://www.elastic.co/"
createIncidentMethod = "put"
})
secrets = jsonencode({
user = "user2"
password = "password2"
})
connector_type_id = ".cases-webhook"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
variable "connector_name" {
description = "The connector name"
type = string
}

variable "connector_id" {
description = "Connector ID"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = var.connector_name
connector_id = var.connector_id
config = jsonencode({
createIncidentJson = "{}"
createIncidentResponseKey = "key"
createIncidentUrl = "https://www.elastic.co/"
getIncidentResponseExternalTitleKey = "title"
getIncidentUrl = "https://www.elastic.co/"
updateIncidentJson = "{}"
updateIncidentUrl = "https://www.elastic.co/"
viewIncidentUrl = "https://www.elastic.co/"
})
secrets = jsonencode({
user = "user1"
password = "password1"
})
connector_type_id = ".cases-webhook"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "connector_name" {
description = "The connector name"
type = string
}

variable "connector_id" {
description = "Connector ID"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = "Updated ${var.connector_name}"
connector_id = var.connector_id
config = jsonencode({
createIncidentJson = "{}"
createIncidentResponseKey = "key"
createIncidentUrl = "https://www.elastic.co/"
getIncidentResponseExternalTitleKey = "title"
getIncidentUrl = "https://www.elastic.co/"
updateIncidentJson = "{}"
updateIncidentUrl = "https://elasticsearch.com/"
viewIncidentUrl = "https://www.elastic.co/"
createIncidentMethod = "put"
})
secrets = jsonencode({
user = "user2"
password = "password2"
})
connector_type_id = ".cases-webhook"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variable "connector_name" {
description = "The connector name"
type = string
}

provider "elasticstack" {
elasticsearch {}
kibana {}
}

resource "elasticstack_kibana_action_connector" "test" {
name = var.connector_name
connector_type_id = ".slack"
secrets = jsonencode({
webhookUrl = "https://example.com/webhook"
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
variable "connector_name" {
description = "The connector name"
type = string
}

provider "elasticstack" {
elasticsearch {}
kibana {}
}

resource "elasticstack_kibana_action_connector" "test" {
name = var.connector_name
config = jsonencode({
index = ".kibana"
refresh = true
})
connector_type_id = ".index"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
variable "connector_name" {
description = "The connector name"
type = string
}
Comment on lines +1 to +4
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All test configuration files define the same connector_name variable with identical description and type. Consider creating a shared variables file to eliminate this duplication across 13 test configuration files.

Copilot uses AI. Check for mistakes.

resource "elasticstack_kibana_action_connector" "test" {
name = var.connector_name
config = jsonencode({
index = ".kibana"
refresh = true
})
connector_type_id = ".index"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
variable "connector_name" {
description = "The connector name"
type = string
}

resource "elasticstack_kibana_action_connector" "test" {
name = "Updated ${var.connector_name}"
config = jsonencode({
index = ".kibana"
refresh = false
})
connector_type_id = ".index"
}