Skip to content

Commit

Permalink
Merge pull request #446 from DFE-Digital/tf-ref-app-sa
Browse files Browse the repository at this point in the history
Add reference to correct storage account
  • Loading branch information
albal authored Feb 28, 2024
2 parents e53cff5 + f9fa81b commit 225cb4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
7 changes: 6 additions & 1 deletion Terraform/private-endpoint.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
Expand Down

0 comments on commit 225cb4d

Please sign in to comment.