Skip to content

Commit 0bc4f6e

Browse files
committed
Full featured graylog setup
* Separate MongoDB * Separate ElasticSearch
1 parent fa3dd8f commit 0bc4f6e

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

modules/mongodb/ecs.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ data "template_file" "mongod_task_config" {
2929
container_name = "mongod-server"
3030
mongo_version = "${var.mongodb_version}"
3131
mongo_container_memory = "${var.mongod_memory_limit}"
32+
mongo_password = "${var.mongodb_password}"
33+
mongo_username = "${var.mongodb_username}"
34+
mongo_database = "${var.mongodb_database}"
3235
native_transport_port = "${var.mongod_port}"
3336
volume_name = "mongo-data"
3437
}

modules/mongodb/resources/mongodb.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"name": "${container_name}",
4-
"image": "mongo:${mongo_version}",
4+
"image": "bitnami/mongodb:${mongo_version}",
55
"memory": ${mongo_container_memory},
66
"essential": true,
77
"portMappings": [
@@ -11,11 +11,15 @@
1111
"protocol": "tcp"
1212
}
1313
],
14-
"environment": [],
14+
"environment": [
15+
{ "name": "MONGODB_USERNAME", "value": "${mongo_username}" },
16+
{ "name": "MONGODB_ROOT_PASSWORD", "value": "${mongo_password}" },
17+
{ "name": "MONGODB_DATABASE", "value": "${mongo_database}" }
18+
],
1519
"mountPoints": [
1620
{
1721
"sourceVolume": "${volume_name}",
18-
"containerPath": "/data/db",
22+
"containerPath": "/bitnami",
1923
"readOnly": false
2024
}
2125
],

modules/mongodb/variables.tf

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,21 @@ variable "trusted_networks" {
8383

8484
variable "mongodb_version" {
8585
type = "string"
86-
default = "3.0.15"
86+
default = "3"
87+
}
88+
89+
variable "mongodb_password" {
90+
type = "string"
91+
}
92+
93+
94+
variable "mongodb_username" {
95+
type = "string"
96+
}
97+
98+
99+
variable "mongodb_database" {
100+
type = "string"
87101
}
88102

89103
variable "mongod_port" {

0 commit comments

Comments
 (0)