Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to analytics storage for cosmos db account #111

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
# --------------------------------------------------------------------------------------

resource "azurerm_cosmosdb_sql_container" "cosmosdb_sql_container" {
name = var.container_name
resource_group_name = var.resource_group_name
account_name = var.cosmos_db_account_name
database_name = var.cosmos_db_name
partition_key_path = var.partition_key_path
partition_key_version = var.partition_key_version
throughput = var.autoscale_enabled == false ? var.throughput : null
default_ttl = var.default_ttl
name = var.container_name
resource_group_name = var.resource_group_name
account_name = var.cosmos_db_account_name
database_name = var.cosmos_db_name
partition_key_path = var.partition_key_path
partition_key_version = var.partition_key_version
throughput = var.autoscale_enabled == false ? var.throughput : null
default_ttl = var.default_ttl
analytical_storage_ttl = var.analytical_storage_ttl

dynamic "autoscale_settings" {
for_each = local.autoscale_setting
Expand Down
6 changes: 6 additions & 0 deletions modules/azurerm/Cosmos-DB-SQL-Container/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ variable "default_ttl" {
description = "The default time to live of SQL container."
type = number
}

variable "analytical_storage_ttl" {
default = null
description = "The default time to live of Analytical Storage for this SQL container"
type = number
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ 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
analytical_storage_enabled = var.analytical_storage_enabled

dynamic "geo_location" {
for_each = local.geo_locations
Expand Down
12 changes: 12 additions & 0 deletions modules/azurerm/Cosmos-Database-Account/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,15 @@ variable "backup_storage_redundancy" {
description = "The backup storage redundancy for the Cosmos DB account."
type = string
}

variable "analytical_storage_enabled" {
default = false
description = "Enable Analytical Storage option for the Cosmos DB account"
type = bool
}

variable "ip_range_filter" {
default = null
description = "A set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs"
type = string
}
Loading