Dear community,
i’m deploying redis cache as “Standard” SKU and public network traffic disabled:
resource "azurerm_redis_cache" "example" {
name = "example-${var.env_name}"
location = data.azurerm_resource_group.example_rg.location
resource_group_name = data.azurerm_resource_group.example_rg.name
capacity = 1
family = "C"
sku_name = "Standard"
enable_non_ssl_port = false
minimum_tls_version = "1.2"
redis_version = 6
public_network_access_enabled = false
redis_configuration {
}
}
The application is running in an PaaS Kubernetes environment which is managed by local IT. For connectivity, I wanted to create a private endpoint via Terraform. I’m facing problems, when it comes to the specification of the subnet_id parameter as redis cache SKU “Standard” is deployed directly into the resource group - for subnetting, we would need to increase the SKU to “Premium”. subnet_id is a required parameter so I can’t skip it and configuring the private-endpoint as follows doesn’t do the trick:
resource "azurerm_private_endpoint" "example_privateEndpoint" {
name = "example-private-endpoint-${var.env_name}"
location = data.azurerm_resource_group.example_rg.location
resource_group_name = data.azurerm_resource_group.example_rg.name
subnet_id = azurerm_redis_cache.example.subnet_id
[ -- deleted the rest of the code for private dns group etc. -- ]
}
I get the following error:
Error: Missing required argument
│
│ with azurerm_private_endpoint.example_privateEndpoint,
│ on main.tf line 66, in resource “azurerm_private_endpoint” “example_privateEndpoint”:
│ 66: subnet_id = azurerm_redis_cache.example.subnet_id
│
│ The argument “subnet_id” is required, but no definition was found.
Did anyone of you guys encounter the same problem and solved it somehow?