diff --git a/.github/workflows/cosmos_api_cd.yaml b/.github/workflows/cosmos_api_cd.yaml
deleted file mode 100644
index 4f069c120..000000000
--- a/.github/workflows/cosmos_api_cd.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: Continuous Delivery on cosmos-api
-
-on:
- workflow_dispatch:
- push:
- branches:
- - main
- paths:
- - "src/cosmos-api/**"
-
-jobs:
- release_prod:
- uses: ./.github/workflows/call_release.yaml
- name: Deploy Infrastructure
- secrets: inherit
- with:
- environment: prod
- dir: "src/cosmos-api/prod"
diff --git a/.github/workflows/cosmos_api_ci.yaml b/.github/workflows/cosmos_api_ci.yaml
deleted file mode 100644
index fcd1d978f..000000000
--- a/.github/workflows/cosmos_api_ci.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-name: Continuous Integration on cosmos-api
-
-on:
- workflow_dispatch:
- pull_request:
- types:
- - opened
- - edited
- - synchronize
- - reopened
- - ready_for_review
- paths:
- - "src/cosmos-api/**"
- - ".github/workflows/cosmos_api_**"
-
-jobs:
- code_review_prod:
- uses: ./.github/workflows/call_code_review.yaml
- name: Code Review Infrastructure Plan
- secrets: inherit
- with:
- environment: prod
- dir: "src/cosmos-api/prod"
diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml
index f0de305d9..72b95f453 100644
--- a/.github/workflows/static_analysis.yml
+++ b/.github/workflows/static_analysis.yml
@@ -44,7 +44,6 @@ jobs:
newmap[src/domains/profile-app]="."
newmap[src/domains/profile-common]="."
newmap[src/domains/functions]="."
- newmap[src/cosmos-api]="./prod"
newmap[src/github-runner]="."
newmap[src/packer]="."
diff --git a/src/common/_modules/cosmos_api/cosmos_account.tf b/src/common/_modules/cosmos_api/cosmos_account.tf
new file mode 100644
index 000000000..71b8b802e
--- /dev/null
+++ b/src/common/_modules/cosmos_api/cosmos_account.tf
@@ -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
+}
diff --git a/src/cosmos-api/prod/cosmos_containers.tf b/src/common/_modules/cosmos_api/cosmos_containers.tf
similarity index 91%
rename from src/cosmos-api/prod/cosmos_containers.tf
rename to src/common/_modules/cosmos_api/cosmos_containers.tf
index 461bde121..323eb8afb 100644
--- a/src/cosmos-api/prod/cosmos_containers.tf
+++ b/src/common/_modules/cosmos_api/cosmos_containers.tf
@@ -10,6 +10,7 @@ resource "azurerm_cosmosdb_sql_container" "these" {
partition_key_path = each.value.partition_key_path
partition_key_version = lookup(each.value, "partition_key_version", 2)
throughput = lookup(each.value, "throughput", null)
+ default_ttl = lookup(each.value, "default_ttl", null)
dynamic "autoscale_settings" {
for_each = lookup(each.value, "autoscale_settings", null) != null ? [1] : []
diff --git a/src/cosmos-api/prod/cosmos_database.tf b/src/common/_modules/cosmos_api/cosmos_database.tf
similarity index 100%
rename from src/cosmos-api/prod/cosmos_database.tf
rename to src/common/_modules/cosmos_api/cosmos_database.tf
diff --git a/src/cosmos-api/prod/locals.tf b/src/common/_modules/cosmos_api/locals.tf
similarity index 91%
rename from src/cosmos-api/prod/locals.tf
rename to src/common/_modules/cosmos_api/locals.tf
index bd791073c..697681719 100644
--- a/src/cosmos-api/prod/locals.tf
+++ b/src/common/_modules/cosmos_api/locals.tf
@@ -1,20 +1,5 @@
locals {
- prefix = "io"
- env_short = "p"
- project = "${local.prefix}-${local.env_short}"
- location = "westeurope"
- secondary_location = "northeurope"
-
- resource_group_name_internal = "${local.project}-rg-internal"
-
- tags = {
- CostCenter = "TS310 - PAGAMENTI & SERVIZI"
- CreatedBy = "Terraform"
- Environment = "Prod"
- Owner = "IO"
- Source = "https://github.com/pagopa/io-infra/blob/main/src/cosmos-api/prod"
- }
-
+ ip_range_filter = ["52.174.88.118", "40.91.208.65", "13.69.64.208/28", "13.69.71.192/27", "13.93.36.78", "20.86.93.32/27", "20.86.93.64/28", "20.126.243.151", "20.126.241.238", "20.103.132.139", "20.103.131.1"]
cosmosdb_containers = [
{
name = "activations"
@@ -68,6 +53,7 @@ locals {
name = "message-status"
partition_key_path = "/messageId"
partition_key_version = null
+ default_ttl = -1
autoscale_settings = {
max_throughput = 67000
}
@@ -84,6 +70,7 @@ locals {
name = "messages"
partition_key_path = "/fiscalCode"
partition_key_version = null
+ default_ttl = -1
autoscale_settings = {
max_throughput = 46000
}
diff --git a/src/cosmos-api/prod/networking.tf b/src/common/_modules/cosmos_api/networking.tf
similarity index 81%
rename from src/cosmos-api/prod/networking.tf
rename to src/common/_modules/cosmos_api/networking.tf
index 74a208bc5..a380d2061 100644
--- a/src/cosmos-api/prod/networking.tf
+++ b/src/common/_modules/cosmos_api/networking.tf
@@ -3,7 +3,7 @@ resource "azurerm_private_endpoint" "sql" {
name = "${azurerm_cosmosdb_account.this.name}-sql-endpoint"
location = azurerm_cosmosdb_account.this.location
resource_group_name = azurerm_cosmosdb_account.this.resource_group_name
- subnet_id = data.azurerm_subnet.pep.id
+ subnet_id = var.pep_snet.id
private_service_connection {
name = "${azurerm_cosmosdb_account.this.name}-sql"
@@ -14,8 +14,8 @@ resource "azurerm_private_endpoint" "sql" {
private_dns_zone_group {
name = "private-dns-zone-group"
- private_dns_zone_ids = [data.azurerm_private_dns_zone.documents.id]
+ private_dns_zone_ids = [var.documents_dns_zone.id]
}
- tags = local.tags
+ tags = var.tags
}
diff --git a/src/common/_modules/cosmos_api/variables.tf b/src/common/_modules/cosmos_api/variables.tf
new file mode 100644
index 000000000..da1c17ebb
--- /dev/null
+++ b/src/common/_modules/cosmos_api/variables.tf
@@ -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"
+}
\ No newline at end of file
diff --git a/src/common/_modules/global/modules/dns/outputs.tf b/src/common/_modules/global/modules/dns/outputs.tf
index a281b0458..645cb0a26 100644
--- a/src/common/_modules/global/modules/dns/outputs.tf
+++ b/src/common/_modules/global/modules/dns/outputs.tf
@@ -34,6 +34,7 @@ output "public_dns_zones" {
output "private_dns_zones" {
value = {
servicebus = azurerm_private_dns_zone.privatelink_servicebus
+ documents = azurerm_private_dns_zone.privatelink_documents
}
}
diff --git a/src/common/prod/README.md b/src/common/prod/README.md
index df0742fa8..126e48640 100644
--- a/src/common/prod/README.md
+++ b/src/common/prod/README.md
@@ -13,6 +13,7 @@
| [apim\_weu](#module\_apim\_weu) | ../_modules/apim | n/a |
| [application\_gateway\_weu](#module\_application\_gateway\_weu) | ../_modules/application_gateway | n/a |
| [assets\_cdn\_weu](#module\_assets\_cdn\_weu) | ../_modules/assets_cdn | n/a |
+| [cosmos\_api\_weu](#module\_cosmos\_api\_weu) | ../_modules/cosmos_api | n/a |
| [event\_hubs\_weu](#module\_event\_hubs\_weu) | ../_modules/event_hubs | n/a |
| [github\_runner\_itn](#module\_github\_runner\_itn) | ../_modules/github_runner | n/a |
| [global](#module\_global) | ../_modules/global | n/a |
@@ -31,6 +32,7 @@
| [azurerm_linux_web_app.firmaconio_selfcare_web_app](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_web_app) | data source |
| [azurerm_resource_group.common_weu](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
| [azurerm_resource_group.internal_weu](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
+| [azurerm_subnet.cosmos_api_allowed](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
| [azurerm_virtual_network.weu_beta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |
| [azurerm_virtual_network.weu_prod01](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |
| [terraform_remote_state.core](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source |
diff --git a/src/common/prod/data.tf b/src/common/prod/data.tf
index 3b831ff5b..0e6962fb1 100644
--- a/src/common/prod/data.tf
+++ b/src/common/prod/data.tf
@@ -48,4 +48,13 @@ data "azurerm_linux_web_app" "app_backendl2" {
data "azurerm_linux_function_app" "function_assets_cdn" {
name = "${local.project_weu_legacy}-assets-cdn-fn"
resource_group_name = "${local.project_weu_legacy}-assets-cdn-rg"
-}
\ No newline at end of file
+}
+
+# Cosmos API
+data "azurerm_subnet" "cosmos_api_allowed" {
+ for_each = toset(local.cosmos_api.allowed_subnets)
+
+ name = each.value
+ virtual_network_name = local.core.networking.weu.vnet_common.name
+ resource_group_name = local.core.networking.weu.vnet_common.resource_group_name
+}
diff --git a/src/common/prod/locals.tf b/src/common/prod/locals.tf
index dfbca0922..3bed1cdff 100644
--- a/src/common/prod/locals.tf
+++ b/src/common/prod/locals.tf
@@ -36,6 +36,10 @@ locals {
}
}
+ cosmos_api = {
+ allowed_subnets = ["fn3admin", "fn3app1", "fn3app2", "fn3appasync", "fn3assets", "fn3public", "fn3services", "fn3slackbot"]
+ }
+
eventhubs = [
{
name = "io-cosmosdb-services"
diff --git a/src/common/prod/westeurope.tf b/src/common/prod/westeurope.tf
index 16faa024e..8f7ce03cc 100644
--- a/src/common/prod/westeurope.tf
+++ b/src/common/prod/westeurope.tf
@@ -380,5 +380,22 @@ module "assets_cdn_weu" {
hostname = data.azurerm_linux_function_app.function_assets_cdn.default_hostname
}
+ tags = local.tags
+}
+
+module "cosmos_api_weu" {
+ source = "../_modules/cosmos_api"
+
+ location = data.azurerm_resource_group.common_weu.location
+ location_short = local.location_short[data.azurerm_resource_group.common_weu.location]
+ project = local.project_weu_legacy
+
+ resource_groups = local.resource_groups[local.location_short[data.azurerm_resource_group.common_weu.location]]
+ vnet_common = local.core.networking.weu.vnet_common
+ pep_snet = local.core.networking.weu.pep_snet
+ secondary_location = "northeurope"
+ documents_dns_zone = module.global.dns.private_dns_zones.documents
+ allowed_subnets_ids = values(data.azurerm_subnet.cosmos_api_allowed)[*].id
+
tags = local.tags
}
\ No newline at end of file
diff --git a/src/core/removed.tf b/src/core/removed.tf
deleted file mode 100644
index 54e55fc5c..000000000
--- a/src/core/removed.tf
+++ /dev/null
@@ -1,111 +0,0 @@
-removed {
- from = module.storage_api_replica.azurerm_storage_account.this
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = module.storage_api_replica.azurerm_security_center_storage_defender.this
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = module.storage_api_replica.azurerm_monitor_metric_alert.storage_account_low_availability
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = module.storage_api_object_replication_to_replica.azurerm_storage_object_replication.this
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = module.storage_api.azurerm_storage_account.this
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = module.storage_api.azurerm_security_center_storage_defender.this
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = module.storage_api.azurerm_monitor_metric_alert.storage_account_low_availability
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_storage_table.storage_api_validationtokens
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_storage_table.storage_api_subscriptionsfeedbyday
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_storage_table.storage_api_faileduserdataprocessing
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_storage_queue.storage_account_apievents_events_queue
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_storage_container.storage_api_message_content
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_storage_container.storage_api_cached
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_monitor_metric_alert.iopstapi_throttling_low_availability
-
- lifecycle {
- destroy = false
- }
-}
diff --git a/src/core/storage_locked_profiles.tf b/src/core/storage_locked_profiles.tf
deleted file mode 100644
index 658a155e2..000000000
--- a/src/core/storage_locked_profiles.tf
+++ /dev/null
@@ -1,27 +0,0 @@
-
-##############################
-# Locked User Profiles Storage
-##############################
-removed {
- from = module.locked_profiles_storage
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_private_endpoint.locked_profiles_storage_table
-
- lifecycle {
- destroy = false
- }
-}
-
-removed {
- from = azurerm_storage_table.locked_profiles
-
- lifecycle {
- destroy = false
- }
-}
\ No newline at end of file
diff --git a/src/cosmos-api/prod/.terraform.lock.hcl b/src/cosmos-api/prod/.terraform.lock.hcl
deleted file mode 100644
index 46da6eca1..000000000
--- a/src/cosmos-api/prod/.terraform.lock.hcl
+++ /dev/null
@@ -1,25 +0,0 @@
-# This file is maintained automatically by "terraform init".
-# Manual edits may be lost in future updates.
-
-provider "registry.terraform.io/hashicorp/azurerm" {
- version = "3.103.1"
- constraints = "<= 3.103.1"
- hashes = [
- "h1:6SACEswBzcN+59PnuUqCwOyLuhEQSgjFX/23YJvJS5Y=",
- "h1:6bkftpJOwSmA74r2ewWu5JrIoSbwzWRAcsv7S/A+6fs=",
- "h1:ahmLlk8mjIu8OoRb/W9kVzACAHu/y4YFL259A0Yg0G0=",
- "h1:ptAxoEtEpgPxT3SVWShUaBnNVCjT9jK5AHfFIoB9rLc=",
- "zh:0e78a947c041893a47d2af804f2896d1337cc06230e730e3926db78d416ba883",
- "zh:21666ab923f659a2fb7a28eee464249acc8617a21eeb4a805fd1acce5f6c0768",
- "zh:357f7daa2f8cc88394d357192f736b21c2626aa99e31bf0dc0dc2fcf6956e555",
- "zh:3bfaaa2b1b20841093c44c863bd3cf31068fc6e51b72f85006aa6e656e6555c6",
- "zh:624d8eea3587b606209cbae89c51070aa85bf4877ea7d4ffeb4cb5d90d0cd3bb",
- "zh:b66a65f0f60e62b9dc911f5376e7801d481810b8c52ae5e36a58730be0779b8a",
- "zh:c0362821d82e9a989de4217527f7b9858cd71923508147ae65f47b32ffd85a0e",
- "zh:ca8d1fc6e67af8970d3655c8f47bccd4e799b2efb5c7ce402ace7462915f30b3",
- "zh:cd9aa496be3900b447a3c3e041e9d25aa6d10a6b0b4d1ebb1385cd6668d35b50",
- "zh:d2350210ad53f1dd18ec29b84255aa7b14877e0f1cb5ae77355f9b8ebe2ea209",
- "zh:f51cbed8c9b225fb346cc42d884c41bf43bb79c90d753e8cf2770362e4689d79",
- "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c",
- ]
-}
diff --git a/src/cosmos-api/prod/README.md b/src/cosmos-api/prod/README.md
deleted file mode 100644
index 140078afe..000000000
--- a/src/cosmos-api/prod/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-## Requirements
-
-| Name | Version |
-|------|---------|
-| [azurerm](#requirement\_azurerm) | <= 3.103.1 |
-
-## Modules
-
-No modules.
-
-## Resources
-
-| Name | Type |
-|------|------|
-| [azurerm_cosmosdb_account.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cosmosdb_account) | resource |
-| [azurerm_cosmosdb_sql_container.these](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cosmosdb_sql_container) | resource |
-| [azurerm_cosmosdb_sql_database.db](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cosmosdb_sql_database) | resource |
-| [azurerm_private_endpoint.sql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
-| [azurerm_private_dns_zone.documents](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/private_dns_zone) | data source |
-| [azurerm_subnet.fn3admin](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.fn3app1](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.fn3app2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.fn3appasync](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.fn3assets](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.fn3public](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.fn3services](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.fn3slackbot](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_subnet.pep](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
-| [azurerm_virtual_network.common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |
-
-## Inputs
-
-No inputs.
-
-## Outputs
-
-No outputs.
-
diff --git a/src/cosmos-api/prod/cosmos_account.tf b/src/cosmos-api/prod/cosmos_account.tf
deleted file mode 100644
index 83eebcf7c..000000000
--- a/src/cosmos-api/prod/cosmos_account.tf
+++ /dev/null
@@ -1,63 +0,0 @@
-resource "azurerm_cosmosdb_account" "this" {
- name = "${local.project}-cosmos-api"
- resource_group_name = local.resource_group_name_internal
- location = local.location
-
- offer_type = "Standard"
- free_tier_enabled = false
-
- automatic_failover_enabled = true
-
- geo_location {
- location = local.location
- failover_priority = 0
- zone_redundant = true
- }
-
- geo_location {
- location = local.secondary_location
- 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
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3admin.id
- }
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3app1.id
- }
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3app2.id
- }
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3appasync.id
- }
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3assets.id
- }
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3public.id
- }
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3services.id
- }
-
- virtual_network_rule {
- id = data.azurerm_subnet.fn3slackbot.id
- }
-
- tags = local.tags
-}
diff --git a/src/cosmos-api/prod/data.tf b/src/cosmos-api/prod/data.tf
deleted file mode 100644
index 3bc88520e..000000000
--- a/src/cosmos-api/prod/data.tf
+++ /dev/null
@@ -1,63 +0,0 @@
-data "azurerm_virtual_network" "common" {
- name = "${local.project}-vnet-common"
- resource_group_name = "${local.project}-rg-common"
-}
-
-data "azurerm_subnet" "pep" {
- name = "pendpoints"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3admin" {
- name = "fn3admin"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3app1" {
- name = "fn3app1"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3app2" {
- name = "fn3app2"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3appasync" {
- name = "fn3appasync"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3assets" {
- name = "fn3assets"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3public" {
- name = "fn3public"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3services" {
- name = "fn3services"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_subnet" "fn3slackbot" {
- name = "fn3slackbot"
- virtual_network_name = data.azurerm_virtual_network.common.name
- resource_group_name = data.azurerm_virtual_network.common.resource_group_name
-}
-
-data "azurerm_private_dns_zone" "documents" {
- name = "privatelink.documents.azure.com"
- resource_group_name = "${local.project}-rg-common"
-}
diff --git a/src/cosmos-api/prod/main.tf b/src/cosmos-api/prod/main.tf
deleted file mode 100644
index cf3cad0d4..000000000
--- a/src/cosmos-api/prod/main.tf
+++ /dev/null
@@ -1,19 +0,0 @@
-terraform {
- required_providers {
- azurerm = {
- source = "hashicorp/azurerm"
- version = "<= 3.103.1"
- }
- }
-
- backend "azurerm" {
- resource_group_name = "terraform-state-rg"
- storage_account_name = "tfinfprodio"
- container_name = "terraform-state"
- key = "io-infra.cosmos-api.tfstate"
- }
-}
-
-provider "azurerm" {
- features {}
-}