From 6b0cf02766ba3908c6e78b0043a3152915fa66c6 Mon Sep 17 00:00:00 2001 From: "mana\"/scriptalert('xss')/script" Date: Thu, 19 Sep 2024 11:24:04 +0200 Subject: [PATCH] feat(multi-region): configurable aws_region for firelens (#154) Allow changing the `aws_region` used by firelense to sign off requests in case the stack was deployed in a region that does match OpenSearch's region. Co-authored-by: Moritz Zimmer --- container_definition.tf | 2 +- envoy.tf | 2 +- variables.tf | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/container_definition.tf b/container_definition.tf index 4446d2e..afa757a 100644 --- a/container_definition.tf +++ b/container_definition.tf @@ -16,7 +16,7 @@ locals { logDriver = "awsfirelens", options = { Aws_Auth = "On" - Aws_Region = data.aws_region.current.name + Aws_Region = null != var.firelens.aws_region ? var.firelens.aws_region : data.aws_region.current.name Host = var.firelens.opensearch_host Logstash_Format = "true" Logstash_Prefix = "${var.service_name}-app" diff --git a/envoy.tf b/envoy.tf index b15fe5c..0c69821 100644 --- a/envoy.tf +++ b/envoy.tf @@ -41,7 +41,7 @@ locals { logDriver = "awsfirelens", options = { Aws_Auth = "On" - Aws_Region = data.aws_region.current.name + Aws_Region = null != var.firelens.aws_region ? var.firelens.aws_region : data.aws_region.current.name Host = var.firelens.opensearch_host Logstash_Format = "true" Logstash_Prefix = "${var.service_name}-envoy" diff --git a/variables.tf b/variables.tf index 6719028..d2414e2 100644 --- a/variables.tf +++ b/variables.tf @@ -332,6 +332,7 @@ variable "firelens" { init_config_files = optional(list(string), []) log_level = optional(string, "info") opensearch_host = optional(string, "") + aws_region = optional(string) }) }