Skip to content

Commit 015098b

Browse files
authored
Merge pull request #7 from PerfectThymeTech/marvinbuss/minor
Minor docs update
2 parents 93a714b + a420b67 commit 015098b

File tree

4 files changed

+91
-17
lines changed

4 files changed

+91
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ The deployed services ensure a compliant encryption setup using the following fe
4949

5050
The Azure Function code is written in Python and leverages the new [Web Framework integration](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=asgi%2Capplication-level&pivots=python-mode-decorators#web-frameworks) supported by the v2 Python programming model. This allows to rely on proven frameworks such as FastAPI and Flask. The Azure Function application code can be found in the [`/code/function` folder](/code/function/).
5151

52-
## FastAPI
52+
### FastAPI
5353

5454
This sample uses FastAPI as a baseline which is a scalable, modern, fast and proven web framework for APIs built in Python. More details about FastAPI can be found [here](https://fastapi.tiangolo.com/).
5555

56-
## Testing
56+
### Testing
5757

5858
Testing of the Azure Functon application code. The testing is done using `pytest`. Tests are stored in the [`/tests` folder](/tests/) and should be extended for new functionality that is being implemented over time. The `pytest.ini` is used to reference the Azure Functon project for imports. This file makes sure that the respective python objects from the Azrue Function application code can be imported into the tests and validated accordingly.

code/infra/logging.tf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,29 @@ resource "azurerm_monitor_private_link_scoped_service" "mpls_log_analytics_works
121121
scope_name = azurerm_monitor_private_link_scope.mpls.name
122122
linked_resource_id = azurerm_log_analytics_workspace.log_analytics_workspace.id
123123
}
124+
125+
resource "azurerm_private_endpoint" "mpls_private_endpoint" {
126+
name = "${azurerm_monitor_private_link_scope.mpls.name}-pe"
127+
location = var.location
128+
resource_group_name = azurerm_monitor_private_link_scope.mpls.resource_group_name
129+
tags = var.tags
130+
131+
custom_network_interface_name = "${azurerm_monitor_private_link_scope.mpls.name}-nic"
132+
private_service_connection {
133+
name = "${azurerm_monitor_private_link_scope.mpls.name}-pe"
134+
is_manual_connection = false
135+
private_connection_resource_id = azurerm_monitor_private_link_scope.mpls.id
136+
subresource_names = ["azuremonitor"]
137+
}
138+
subnet_id = azapi_resource.subnet_services.id
139+
private_dns_zone_group {
140+
name = "${azurerm_monitor_private_link_scope.mpls.name}-arecord"
141+
private_dns_zone_ids = [
142+
var.private_dns_zone_id_monitor,
143+
var.private_dns_zone_id_oms_opinsights,
144+
var.private_dns_zone_id_ods_opinsights,
145+
var.private_dns_zone_id_automation_agents,
146+
var.private_dns_zone_id_blob
147+
]
148+
}
149+
}

code/infra/variables.tf

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,47 @@ variable "private_dns_zone_id_sites" {
148148
error_message = "Please specify a valid resource ID for the private DNS Zone."
149149
}
150150
}
151+
152+
variable "private_dns_zone_id_monitor" {
153+
description = "Specifies the resource ID of the private DNS zone for Azure Monitor. Not required if DNS A-records get created via Azue Policy."
154+
type = string
155+
sensitive = false
156+
default = ""
157+
validation {
158+
condition = var.private_dns_zone_id_monitor == "" || (length(split("/", var.private_dns_zone_id_monitor)) == 9 && endswith(var.private_dns_zone_id_monitor, "privatelink.monitor.azure.com"))
159+
error_message = "Please specify a valid resource ID for the private DNS Zone."
160+
}
161+
}
162+
163+
variable "private_dns_zone_id_oms_opinsights" {
164+
description = "Specifies the resource ID of the private DNS zone for Azure Monitor OMS Insights. Not required if DNS A-records get created via Azue Policy."
165+
type = string
166+
sensitive = false
167+
default = ""
168+
validation {
169+
condition = var.private_dns_zone_id_oms_opinsights == "" || (length(split("/", var.private_dns_zone_id_oms_opinsights)) == 9 && endswith(var.private_dns_zone_id_oms_opinsights, "privatelink.oms.opinsights.azure.com"))
170+
error_message = "Please specify a valid resource ID for the private DNS Zone."
171+
}
172+
}
173+
174+
variable "private_dns_zone_id_ods_opinsights" {
175+
description = "Specifies the resource ID of the private DNS zone for Azure Monitor ODS Insights. Not required if DNS A-records get created via Azue Policy."
176+
type = string
177+
sensitive = false
178+
default = ""
179+
validation {
180+
condition = var.private_dns_zone_id_ods_opinsights == "" || (length(split("/", var.private_dns_zone_id_ods_opinsights)) == 9 && endswith(var.private_dns_zone_id_ods_opinsights, "privatelink.ods.opinsights.azure.com"))
181+
error_message = "Please specify a valid resource ID for the private DNS Zone."
182+
}
183+
}
184+
185+
variable "private_dns_zone_id_automation_agents" {
186+
description = "Specifies the resource ID of the private DNS zone for Azure Monitor Automation Agents. Not required if DNS A-records get created via Azue Policy."
187+
type = string
188+
sensitive = false
189+
default = ""
190+
validation {
191+
condition = var.private_dns_zone_id_automation_agents == "" || (length(split("/", var.private_dns_zone_id_automation_agents)) == 9 && endswith(var.private_dns_zone_id_automation_agents, "privatelink.agentsvc.azure-automation.net"))
192+
error_message = "Please specify a valid resource ID for the private DNS Zone."
193+
}
194+
}

code/infra/vars.dev.tfvars

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
location = "northeurope"
2-
environment = "dev"
3-
prefix = "myfunc"
4-
tags = {}
5-
function_python_version = "3.10"
6-
function_health_path = "/v1/health/heartbeat"
7-
vnet_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/virtualNetworks/mycrp-prd-function-vnet001"
8-
nsg_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/networkSecurityGroups/mycrp-prd-function-nsg001"
9-
route_table_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/routeTables/mycrp-prd-function-rt001"
10-
private_dns_zone_id_blob = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net"
11-
private_dns_zone_id_queue = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.queue.core.windows.net"
12-
private_dns_zone_id_table = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.table.core.windows.net"
13-
private_dns_zone_id_file = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.file.core.windows.net"
14-
private_dns_zone_id_key_vault = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net"
15-
private_dns_zone_id_sites = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.azurewebsites.net"
1+
location = "northeurope"
2+
environment = "dev"
3+
prefix = "myfunc"
4+
tags = {}
5+
function_python_version = "3.10"
6+
function_health_path = "/v1/health/heartbeat"
7+
vnet_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/virtualNetworks/mycrp-prd-function-vnet001"
8+
nsg_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/networkSecurityGroups/mycrp-prd-function-nsg001"
9+
route_table_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/routeTables/mycrp-prd-function-rt001"
10+
private_dns_zone_id_blob = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net"
11+
private_dns_zone_id_queue = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.queue.core.windows.net"
12+
private_dns_zone_id_table = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.table.core.windows.net"
13+
private_dns_zone_id_file = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.file.core.windows.net"
14+
private_dns_zone_id_key_vault = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.vaultcore.azure.net"
15+
private_dns_zone_id_sites = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.azurewebsites.net"
16+
private_dns_zone_id_monitor = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.monitor.azure.com"
17+
private_dns_zone_id_oms_opinsights = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.oms.opinsights.azure.com"
18+
private_dns_zone_id_ods_opinsights = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.ods.opinsights.azure.com"
19+
private_dns_zone_id_automation_agents = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.agentsvc.azure-automation.net"

0 commit comments

Comments
 (0)