From 4510a1b600d23b884b38c76a601a91e678ef9e3c Mon Sep 17 00:00:00 2001 From: Veronika Gnilitska Date: Mon, 12 Apr 2021 12:49:52 +0300 Subject: [PATCH] feat: support custom enpoint configuration --- main.tf | 7 +++++-- variables.tf | 18 ++++++++++++++++++ versions.tf | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index d00f718..9d3da47 100644 --- a/main.tf +++ b/main.tf @@ -127,8 +127,11 @@ resource "aws_elasticsearch_domain" "default" { } domain_endpoint_options { - enforce_https = var.domain_endpoint_options_enforce_https - tls_security_policy = var.domain_endpoint_options_tls_security_policy + enforce_https = var.domain_endpoint_options_enforce_https + tls_security_policy = var.domain_endpoint_options_tls_security_policy + custom_endpoint_enabled = var.custom_endpoint_enabled + custom_endpoint = var.custom_endpoint_enabled ? var.custom_endpoint : null + custom_endpoint_certificate_arn = var.custom_endpoint_enabled ? var.custom_endpoint_certificate_arn : null } cluster_config { diff --git a/variables.tf b/variables.tf index 5f5296c..a5e4839 100644 --- a/variables.tf +++ b/variables.tf @@ -333,3 +333,21 @@ variable "advanced_security_options_master_user_password" { default = "" description = "Master user password (applicable if advanced_security_options_internal_user_database_enabled set to true)" } + +variable "custom_endpoint_enabled" { + type = bool + description = "Whether to enable custom endpoint for the Elasticsearch domain." + default = false +} + +variable "custom_endpoint" { + type = string + description = "Fully qualified domain for custom endpoint." + default = "" +} + +variable "custom_endpoint_certificate_arn" { + type = string + description = "ACM certificate ARN for custom endpoint." + default = "" +} \ No newline at end of file diff --git a/versions.tf b/versions.tf index fa5b7ea..5274332 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 2.0" + version = ">= 3.35.0" } template = { source = "hashicorp/template"