From f9fa81b7a87127303115e85e31d34833503eb9b2 Mon Sep 17 00:00:00 2001 From: Al West Date: Wed, 28 Feb 2024 14:16:33 +0000 Subject: [PATCH] Add reference to correct storage account --- Terraform/README.md | 1 + Terraform/private-endpoint.tf | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Terraform/README.md b/Terraform/README.md index 2ad77204..f442c46a 100644 --- a/Terraform/README.md +++ b/Terraform/README.md @@ -54,6 +54,7 @@ No modules. | [azurerm_log_analytics_workspace.log-analytics-ws](https://registry.terraform.io/providers/hashicorp/azurerm/3.90.0/docs/data-sources/log_analytics_workspace) | data source | | [azurerm_public_ip.pip1](https://registry.terraform.io/providers/hashicorp/azurerm/3.90.0/docs/data-sources/public_ip) | data source | | [azurerm_resource_group.rg](https://registry.terraform.io/providers/hashicorp/azurerm/3.90.0/docs/data-sources/resource_group) | data source | +| [azurerm_storage_account.webappsa](https://registry.terraform.io/providers/hashicorp/azurerm/3.90.0/docs/data-sources/storage_account) | data source | | [azurerm_user_assigned_identity.appsauai](https://registry.terraform.io/providers/hashicorp/azurerm/3.90.0/docs/data-sources/user_assigned_identity) | data source | | [azurerm_user_assigned_identity.uai](https://registry.terraform.io/providers/hashicorp/azurerm/3.90.0/docs/data-sources/user_assigned_identity) | data source | | [azurerm_virtual_network.vnet1](https://registry.terraform.io/providers/hashicorp/azurerm/3.90.0/docs/data-sources/virtual_network) | data source | diff --git a/Terraform/private-endpoint.tf b/Terraform/private-endpoint.tf index f160249b..6b2bb179 100644 --- a/Terraform/private-endpoint.tf +++ b/Terraform/private-endpoint.tf @@ -90,6 +90,11 @@ resource "azurerm_private_endpoint" "privateendpoint-gf" { tags = data.azurerm_resource_group.rg.tags } +data "azurerm_storage_account" "webappsa" { + name = var.cpd_azure_storage_account[terraform.workspace] + resource_group_name = data.azurerm_resource_group.rg.name +} + # Definition of the private end point for the application storage resource "azurerm_private_endpoint" "privateendpoint-sa" { name = "${var.private_endpoint_name[terraform.workspace]}-sa" @@ -104,7 +109,7 @@ resource "azurerm_private_endpoint" "privateendpoint-sa" { private_service_connection { name = "${var.private_endpoint_conn_name[terraform.workspace]}-sa" - private_connection_resource_id = azurerm_storage_account.gfsa.id + private_connection_resource_id = data.azurerm_storage_account.webappsa.id subresource_names = ["blob"] is_manual_connection = false }