diff --git a/manifests/elastic/main.tf b/manifests/elastic/main.tf index 5c0f658c7336b768e4065bce9b19402d73dd210b..5a86d27e80b3b04dfd7f0f6a29736dcbb76c60b9 100644 --- a/manifests/elastic/main.tf +++ b/manifests/elastic/main.tf @@ -9,4 +9,36 @@ terraform { provider "ec" { apikey = var.ec_apikey -} \ No newline at end of file +} + +data "ec_stack" "stack" { + version_regex = "7.15.2" + region = var.region +} + +resource "ec_deployment" "elasticsearch_cluster" { + name = "mon-cluster" + + region = data.ec_stack.stack.region + version = data.ec_stack.stack.version_regex + deployment_template_id = "gcp-storage-optimized" + + elasticsearch { + autoscale = "false" + + topology { + id = "hot_content" + size_resource = "memory" + size = "1g" + zone_count = 1 + } + } + + kibana { + topology { + size_resource = "memory" + size = "1g" + zone_count = 1 + } + } +} diff --git a/manifests/elastic/variables.tf b/manifests/elastic/variables.tf index 2b4efd359de71b54331b9d6a0c9434d6358fced9..1c47852e862be89ba5893b878c3f374d56da2e3a 100644 --- a/manifests/elastic/variables.tf +++ b/manifests/elastic/variables.tf @@ -1,3 +1,8 @@ variable "ec_apikey" { type = string -} \ No newline at end of file +} + +variable "region" { + type = string + default = "gcp-europe-west1" +}