-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CES-103] - Moved cosmos-api to common folder (#1173)
Co-authored-by: Andrea Grillo <[email protected]>
- Loading branch information
1 parent
9afd0d3
commit 8f98e87
Showing
21 changed files
with
147 additions
and
410 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
resource "azurerm_cosmosdb_account" "this" { | ||
name = "${var.project}-cosmos-api" | ||
resource_group_name = var.resource_groups.internal | ||
location = var.location | ||
|
||
offer_type = "Standard" | ||
free_tier_enabled = false | ||
|
||
automatic_failover_enabled = true | ||
ip_range_filter = join(",", local.ip_range_filter) | ||
|
||
geo_location { | ||
location = var.location | ||
failover_priority = 0 | ||
zone_redundant = true | ||
} | ||
|
||
dynamic "geo_location" { | ||
for_each = var.secondary_location != null ? [var.secondary_location] : [] | ||
content { | ||
location = geo_location.value | ||
failover_priority = 1 | ||
zone_redundant = false | ||
} | ||
} | ||
|
||
consistency_policy { | ||
consistency_level = "Strong" # TODO: Consider returning to BoundedSession | ||
} | ||
|
||
public_network_access_enabled = true | ||
is_virtual_network_filter_enabled = true | ||
|
||
dynamic "virtual_network_rule" { | ||
for_each = var.allowed_subnets_ids | ||
|
||
content { | ||
id = virtual_network_rule.value | ||
} | ||
} | ||
|
||
tags = var.tags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
variable "project" { | ||
type = string | ||
description = "IO prefix, short environment and short location" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "Azure region" | ||
} | ||
|
||
variable "location_short" { | ||
type = string | ||
description = "Azure region short name" | ||
} | ||
|
||
variable "tags" { | ||
type = map(any) | ||
description = "Resource tags" | ||
} | ||
|
||
variable "resource_groups" { | ||
type = map(string) | ||
description = "Resource group names" | ||
} | ||
|
||
variable "vnet_common" { | ||
type = object({ | ||
id = string | ||
name = string | ||
address_space = list(string) | ||
resource_group_name = string | ||
}) | ||
description = "Information of the common VNet" | ||
} | ||
|
||
variable "pep_snet" { | ||
type = object({ | ||
id = string | ||
name = string | ||
address_prefixes = list(string) | ||
}) | ||
} | ||
|
||
variable "secondary_location" { | ||
type = string | ||
description = "The secondary location used for geo_replication of the cosmos database. If omitted, geo replication is not enabled." | ||
|
||
default = null | ||
} | ||
|
||
variable "documents_dns_zone" { | ||
type = object({ | ||
id = string | ||
name = string | ||
resource_group_name = string | ||
}) | ||
description = "Private link documents dns zone information" | ||
} | ||
|
||
variable "allowed_subnets_ids" { | ||
type = list(string) | ||
description = "List of the IDs of the subnets allowed to contact the cosmos account" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.