Skip to content

Commit 758e34a

Browse files
authored
Migrate fleet output acceptance tests (#1509)
1 parent 45fd09b commit 758e34a

File tree

18 files changed

+373
-268
lines changed

18 files changed

+373
-268
lines changed

internal/fleet/output/acc_test.go

Lines changed: 80 additions & 268 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
kibana {}
4+
}
5+
6+
resource "elasticstack_fleet_output" "test_output" {
7+
name = "Elasticsearch Output ${var.policy_name}"
8+
output_id = "${var.policy_name}-elasticsearch-output"
9+
type = "elasticsearch"
10+
config_yaml = yamlencode({
11+
"ssl.verification_mode" : "none"
12+
})
13+
default_integrations = false
14+
default_monitoring = false
15+
hosts = [
16+
"https://elasticsearch:9200"
17+
]
18+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "policy_name" {
2+
type = string
3+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
kibana {}
4+
}
5+
6+
resource "elasticstack_fleet_output" "test_output" {
7+
name = "Updated Elasticsearch Output ${var.policy_name}"
8+
output_id = "${var.policy_name}-elasticsearch-output"
9+
type = "elasticsearch"
10+
config_yaml = yamlencode({
11+
"ssl.verification_mode" : "none"
12+
})
13+
default_integrations = false
14+
default_monitoring = false
15+
hosts = [
16+
"https://elasticsearch:9200"
17+
]
18+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "policy_name" {
2+
type = string
3+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
kibana {}
4+
}
5+
variable "policy_name" {
6+
type = string
7+
}
8+
9+
resource "elasticstack_fleet_output" "test_output" {
10+
name = "Elasticsearch Output ${var.policy_name}"
11+
output_id = "${var.policy_name}-elasticsearch-output"
12+
type = "elasticsearch"
13+
config_yaml = yamlencode({
14+
"ssl.verification_mode" : "none"
15+
})
16+
default_integrations = false
17+
default_monitoring = false
18+
hosts = [
19+
"https://elasticsearch:9200"
20+
]
21+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
kibana {}
4+
}
5+
6+
resource "elasticstack_fleet_output" "test_output" {
7+
name = "Kafka Output ${var.policy_name}"
8+
output_id = "${var.policy_name}-kafka-output"
9+
type = "kafka"
10+
config_yaml = yamlencode({
11+
"ssl.verification_mode" : "none"
12+
})
13+
default_integrations = false
14+
default_monitoring = false
15+
hosts = [
16+
"kafka:9092"
17+
]
18+
19+
# Kafka-specific configuration
20+
kafka = {
21+
auth_type = "none"
22+
topic = "beats"
23+
partition = "hash"
24+
compression = "gzip"
25+
compression_level = 6
26+
connection_type = "plaintext"
27+
required_acks = 1
28+
29+
headers = [{
30+
key = "environment"
31+
value = "test"
32+
}]
33+
}
34+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "policy_name" {
2+
type = string
3+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
kibana {}
4+
}
5+
6+
resource "elasticstack_fleet_output" "test_output" {
7+
name = "Updated Kafka Output ${var.policy_name}"
8+
output_id = "${var.policy_name}-kafka-output"
9+
type = "kafka"
10+
config_yaml = yamlencode({
11+
"ssl.verification_mode" : "none"
12+
})
13+
default_integrations = false
14+
default_monitoring = false
15+
hosts = [
16+
"kafka:9092"
17+
]
18+
19+
# Updated Kafka-specific configuration
20+
kafka = {
21+
auth_type = "none"
22+
topic = "logs"
23+
partition = "round_robin"
24+
compression = "snappy"
25+
connection_type = "encryption"
26+
required_acks = -1
27+
}
28+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "policy_name" {
2+
type = string
3+
}

0 commit comments

Comments
 (0)