From f8c5551338ceab3e060f2db84f925dad1b1105b1 Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 23 Oct 2024 15:09:11 +0530 Subject: [PATCH] Allow to pass allowed Client IP list for Cosmos DB --- .../Cosmos-Database-Account/cosmos_database_account.tf | 1 + modules/azurerm/Cosmos-Database-Account/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/modules/azurerm/Cosmos-Database-Account/cosmos_database_account.tf b/modules/azurerm/Cosmos-Database-Account/cosmos_database_account.tf index 53e19285..c45fb2a6 100644 --- a/modules/azurerm/Cosmos-Database-Account/cosmos_database_account.tf +++ b/modules/azurerm/Cosmos-Database-Account/cosmos_database_account.tf @@ -18,6 +18,7 @@ resource "azurerm_cosmosdb_account" "cosmos_db_account" { tags = var.tags enable_free_tier = var.enable_free_tier public_network_access_enabled = var.public_network_access_enabled + ip_range_filter = var.ip_range_filter enable_multiple_write_locations = var.enable_multiple_write_locations enable_automatic_failover = length(local.geo_locations) == 1 ? false : var.enable_automatic_failover is_virtual_network_filter_enabled = var.is_virtual_network_filter_enabled diff --git a/modules/azurerm/Cosmos-Database-Account/variables.tf b/modules/azurerm/Cosmos-Database-Account/variables.tf index f60cedcc..594f7204 100644 --- a/modules/azurerm/Cosmos-Database-Account/variables.tf +++ b/modules/azurerm/Cosmos-Database-Account/variables.tf @@ -142,3 +142,9 @@ variable "analytical_storage_enabled" { description = "Enable Analytical Storage option for the Cosmos DB account" type = bool } + +variable "ip_range_filter" { + default = [] + description = "A set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs" + type = list(string) +}