Skip to content

Commit

Permalink
[#IOPID-2340] Remove migrated citizen auth redis in weu
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnedMarshal committed Oct 10, 2024
1 parent 3bab063 commit 2ff640f
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 72 deletions.
5 changes: 0 additions & 5 deletions src/domains/citizen-auth-app/04_redis.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# Citizen-auth domain Redis Common
data "azurerm_redis_cache" "redis_common" {
name = format("%s-%s-%s-redis-std-v6", local.product, var.location_short, var.domain)
resource_group_name = data.azurerm_resource_group.data_rg.name
}

data "azurerm_redis_cache" "redis_common_itn" {
name = format("%s-redis-std-v6", local.project_itn)
resource_group_name = data.azurerm_resource_group.data_rg_itn.name
Expand Down
1 change: 0 additions & 1 deletion src/domains/citizen-auth-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
| [azurerm_private_dns_zone.privatelink_queue_core_windows_net](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/private_dns_zone) | data source |
| [azurerm_private_dns_zone.privatelink_table_core_windows_net](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/private_dns_zone) | data source |
| [azurerm_redis_cache.core_domain_redis_common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/redis_cache) | data source |
| [azurerm_redis_cache.redis_common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/redis_cache) | data source |
| [azurerm_redis_cache.redis_common_itn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/redis_cache) | data source |
| [azurerm_resource_group.core_domain_common_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
| [azurerm_resource_group.data_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
Expand Down
13 changes: 2 additions & 11 deletions src/domains/citizen-auth-common/01_network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ data "azurerm_subnet" "private_endpoints_subnet_itn" {
resource_group_name = "io-p-itn-common-rg-01"
}

## Redis Common subnet
module "redis_common_snet" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v8.44.1"
name = format("%s-redis-snet", local.project)
address_prefixes = var.cidr_subnet_redis_common
resource_group_name = local.vnet_common_resource_group_name
virtual_network_name = local.vnet_common_name

private_endpoint_network_policies_enabled = false
}

## Cosmos Private Endpoint
resource "azurerm_private_endpoint" "cosmos_db" {
name = "${local.project_itn}-account-sql-pep-01"
Expand All @@ -82,6 +71,8 @@ resource "azurerm_private_endpoint" "cosmos_db" {
subresource_names = ["Sql"]
}
}

## Redis Common subnet
module "redis_common_snet_itn" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v8.44.1"
name = format("%s-redis-snet", local.project_itn)
Expand Down
46 changes: 0 additions & 46 deletions src/domains/citizen-auth-common/04_redis_common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,6 @@
/**
* [REDIS V6]
*/
module "redis_common" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//redis_cache?ref=v8.44.1"
name = format("%s-redis-std-v6", local.project)
resource_group_name = azurerm_resource_group.data_rg.name
location = azurerm_resource_group.data_rg.location
capacity = 1
family = "C"
sku_name = "Standard"
redis_version = "6"
enable_authentication = true
zones = null

// when azure can apply patch?
patch_schedules = [{
day_of_week = "Sunday"
start_hour_utc = 23
},
{
day_of_week = "Monday"
start_hour_utc = 23
},
{
day_of_week = "Tuesday"
start_hour_utc = 23
},
{
day_of_week = "Wednesday"
start_hour_utc = 23
},
{
day_of_week = "Thursday"
start_hour_utc = 23
},
]

private_endpoint = {
enabled = true
virtual_network_id = data.azurerm_virtual_network.vnet_common.id
subnet_id = module.redis_common_snet.id
private_dns_zone_ids = [data.azurerm_private_dns_zone.privatelink_redis_cache.id]
}

tags = var.tags
}


resource "azurerm_resource_group" "data_rg_itn" {
name = "${local.project_itn}-data-rg-01"
location = local.itn_location
Expand Down
5 changes: 0 additions & 5 deletions src/domains/citizen-auth-common/99_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ variable "enable_azdoa" {
}

# Redis Common
variable "cidr_subnet_redis_common" {
type = list(string)
description = "Redis Common address space."
}

variable "cidr_subnet_redis_common_itn" {
type = list(string)
description = "Redis Common address space."
Expand Down
3 changes: 0 additions & 3 deletions src/domains/citizen-auth-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
| <a name="module_key_vault"></a> [key\_vault](#module\_key\_vault) | git::https://github.com/pagopa/terraform-azurerm-v3.git//key_vault | v8.44.1 |
| <a name="module_lollipop_assertions_storage"></a> [lollipop\_assertions\_storage](#module\_lollipop\_assertions\_storage) | github.com/pagopa/terraform-azurerm-v3//storage_account | v8.12.0 |
| <a name="module_lollipop_assertions_storage_customer_managed_key"></a> [lollipop\_assertions\_storage\_customer\_managed\_key](#module\_lollipop\_assertions\_storage\_customer\_managed\_key) | git::https://github.com/pagopa/terraform-azurerm-v3//storage_account_customer_managed_key | v8.12.0 |
| <a name="module_redis_common"></a> [redis\_common](#module\_redis\_common) | git::https://github.com/pagopa/terraform-azurerm-v3.git//redis_cache | v8.44.1 |
| <a name="module_redis_common_itn"></a> [redis\_common\_itn](#module\_redis\_common\_itn) | git::https://github.com/pagopa/terraform-azurerm-v3.git//redis_cache | v8.44.1 |
| <a name="module_redis_common_snet"></a> [redis\_common\_snet](#module\_redis\_common\_snet) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v8.44.1 |
| <a name="module_redis_common_snet_itn"></a> [redis\_common\_snet\_itn](#module\_redis\_common\_snet\_itn) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v8.44.1 |

## Resources
Expand Down Expand Up @@ -121,7 +119,6 @@
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_application_insights_name"></a> [application\_insights\_name](#input\_application\_insights\_name) | Specifies the name of the Application Insights. | `string` | n/a | yes |
| <a name="input_cidr_subnet_redis_common"></a> [cidr\_subnet\_redis\_common](#input\_cidr\_subnet\_redis\_common) | Redis Common address space. | `list(string)` | n/a | yes |
| <a name="input_cidr_subnet_redis_common_itn"></a> [cidr\_subnet\_redis\_common\_itn](#input\_cidr\_subnet\_redis\_common\_itn) | Redis Common address space. | `list(string)` | n/a | yes |
| <a name="input_citizen_auth_database"></a> [citizen\_auth\_database](#input\_citizen\_auth\_database) | n/a | <pre>map(<br> object({<br> max_throughput = number<br> ttl = number<br> })<br> )</pre> | n/a | yes |
| <a name="input_domain"></a> [domain](#input\_domain) | n/a | `string` | n/a | yes |
Expand Down
1 change: 0 additions & 1 deletion src/domains/citizen-auth-common/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ application_insights_name = "io-p-ai-common"
# You can retrieve the list of current defined subnets using the CLI command
# az network vnet subnet list --subscription PROD-IO --vnet-name io-p-vnet-common --resource-group io-p-rg-common --output table
# and thus define new CIDRs according to the unallocated address space
cidr_subnet_redis_common = ["10.0.118.0/24"]
cidr_subnet_redis_common_itn = ["10.20.17.0/24"]

0 comments on commit 2ff640f

Please sign in to comment.