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 subnet of pct-sas kubernetes cluster to pct-api storage account #230

Merged
merged 1 commit into from
Jul 2, 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
2 changes: 1 addition & 1 deletion deployment/terraform/resources/storage_account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "azurerm_storage_account" "pc" {

network_rules {
default_action = "Deny"
virtual_network_subnet_ids = [azurerm_subnet.node_subnet.id, azurerm_subnet.function_subnet.id]
virtual_network_subnet_ids = [azurerm_subnet.node_subnet.id, azurerm_subnet.function_subnet.id, data.azurerm_subnet.sas_node_subnet.id]
}

# Disabling shared access keys breaks terraform's ability to do subsequent
Expand Down
11 changes: 11 additions & 0 deletions deployment/terraform/resources/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ variable "func_storage_account_url" {
type = string
}

variable "sas_node_subnet_name" {
type = string
}

variable "sas_node_subnet_virtual_network_name" {
type = string
}

variable "sas_node_subnet_resource_group_name" {
type = string
}
# -----------------
# Local variables

Expand Down
6 changes: 6 additions & 0 deletions deployment/terraform/resources/vnet.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ resource "azurerm_subnet" "cache_subnet" {
service_endpoints = []
}

data "azurerm_subnet" "sas_node_subnet" {
name = var.sas_node_subnet_name
virtual_network_name = var.sas_node_subnet_virtual_network_name
resource_group_name = var.sas_node_subnet_resource_group_name
}

resource "azurerm_subnet" "function_subnet" {
name = "${local.prefix}-functions-subnet"
virtual_network_name = azurerm_virtual_network.pc.name
Expand Down
4 changes: 4 additions & 0 deletions deployment/terraform/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module "resources" {
prod_log_analytics_workspace_id = "78d48390-b6bb-49a9-b7fd-a86f6522e9c4"
func_storage_account_url = "https://pctapisstagingsa.table.core.windows.net/"
banned_ip_table = "blobstoragebannedip"

sas_node_subnet_name = "pct-sas-westeurope-staging-node-subnet"
sas_node_subnet_virtual_network_name = "pct-sas-westeurope-staging-network"
sas_node_subnet_resource_group_name = "pct-sas-westeurope-staging_rg"
}

terraform {
Expand Down
Loading