@@ -13,12 +13,6 @@ diff -Naur ../base/terraform/airlock/data.tf terraform/airlock/data.tf
13
13
diff -Naur ../base/terraform/airlock/locals.tf terraform/airlock/locals.tf
14
14
--- ../base/terraform/airlock/locals.tf 2022-08-17 12:09:06.000000000 +0100
15
15
+++ terraform/airlock/locals.tf 2022-09-14 23:46:54.000000000 +0100
16
- @@ -1,4 +1,5 @@
17
- locals {
18
- + core_vnet = "vnet-${var.tre_id}"
19
- core_resource_group_name = "rg-${var.tre_id}"
20
- workspace_resource_name_suffix = "${var.tre_id}-ws-${var.short_workspace_id}"
21
-
22
16
@@ -11,6 +12,8 @@
23
17
24
18
# STorage AirLock IMport APProved
@@ -28,25 +22,6 @@ diff -Naur ../base/terraform/airlock/locals.tf terraform/airlock/locals.tf
28
22
# STorage AirLock EXport INTernal
29
23
export_internal_storage_name = lower(replace("stalexint${substr(local.workspace_resource_name_suffix, -8, -1)}", "-", ""))
30
24
# STorage AirLock EXport InProgress
31
- @@ -19,18 +22,4 @@
32
- export_rejected_storage_name = lower(replace("stalexrej${substr(local.workspace_resource_name_suffix, -8, -1)}", "-", ""))
33
- # STorage AirLock EXport BLOCKED
34
- export_blocked_storage_name = lower(replace("stalexblocked${substr(local.workspace_resource_name_suffix, -8, -1)}", "-", ""))
35
- -
36
- - airlock_blob_data_contributor = [
37
- - azurerm_storage_account.sa_import_approved.id,
38
- - azurerm_storage_account.sa_export_internal.id,
39
- - azurerm_storage_account.sa_export_inprogress.id,
40
- - azurerm_storage_account.sa_export_rejected.id,
41
- - azurerm_storage_account.sa_export_blocked.id
42
- - ]
43
- -
44
- - api_sa_data_contributor = [
45
- - azurerm_storage_account.sa_import_approved.id,
46
- - azurerm_storage_account.sa_export_internal.id,
47
- - azurerm_storage_account.sa_export_inprogress.id
48
- - ]
49
- }
50
25
diff -Naur ../base/terraform/airlock/storage_accounts.tf terraform/airlock/storage_accounts.tf
51
26
--- ../base/terraform/airlock/storage_accounts.tf 2022-08-17 12:09:06.000000000 +0100
52
27
+++ terraform/airlock/storage_accounts.tf 2022-09-14 23:46:54.000000000 +0100
@@ -57,20 +32,20 @@ diff -Naur ../base/terraform/airlock/storage_accounts.tf terraform/airlock/stora
57
32
+ # 'In progress' storage account
58
33
+
59
34
+ resource "azurerm_private_endpoint" "sa_import_inprogress_pe" {
60
- + name = "stg-ip-import-blob-${var.tre_id}-ws-${var.short_workspace_id }"
35
+ + name = "stg-ip-import-blob-${local.workspace_resource_name_suffix }"
61
36
+ location = var.location
62
37
+ resource_group_name = var.ws_resource_group_name
63
38
+ subnet_id = var.services_subnet_id
64
39
+
65
40
+ lifecycle { ignore_changes = [tags] }
66
41
+
67
42
+ private_dns_zone_group {
68
- + name = "private-dns-zone-group- stg-import-ip "
43
+ + name = "pdzg- stg-ip- import-blob-${local.workspace_resource_name_suffix} "
69
44
+ private_dns_zone_ids = [data.azurerm_private_dns_zone.blobcore.id]
70
45
+ }
71
46
+
72
47
+ private_service_connection {
73
- + name = "psc-stgipimport-${var.tre_id }"
48
+ + name = "psc-stg-ip-import-blob-${local.workspace_resource_name_suffix }"
74
49
+ private_connection_resource_id = data.azurerm_storage_account.sa_import_inprogress.id
75
50
+ is_manual_connection = false
76
51
+ subresource_names = ["Blob"]
@@ -81,77 +56,6 @@ diff -Naur ../base/terraform/airlock/storage_accounts.tf terraform/airlock/stora
81
56
82
57
# 'Drop' location for export
83
58
resource "azurerm_storage_account" "sa_export_internal" {
84
- @@ -259,19 +283,59 @@
85
- }
86
- }
87
-
88
- - # we can't use for_each due to the data object
89
- - resource "azurerm_role_assignment" "airlock_blob_data_contributor" {
90
- - count = length(local.airlock_blob_data_contributor)
91
- - scope = local.airlock_blob_data_contributor[count.index]
92
- - role_definition_name = "Storage Blob Data Contributor"
93
- + resource "azurerm_role_assignment" "sa_import_approved" {
94
- + scope = azurerm_storage_account.sa_import_approved.id
95
- + role_definition_name = "Contributor"
96
- + principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
97
- + }
98
- +
99
- +
100
- + resource "azurerm_role_assignment" "sa_export_internal" {
101
- + scope = azurerm_storage_account.sa_export_internal.id
102
- + role_definition_name = "Contributor"
103
- principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
104
- }
105
-
106
- - # This might be considered redundent since we give Virtual Machine Contributor
107
- - # at the subscription level, but best to be explicit.
108
- - resource "azurerm_role_assignment" "api_sa_data_contributor" {
109
- - count = length(local.api_sa_data_contributor)
110
- - scope = local.api_sa_data_contributor[count.index]
111
- - role_definition_name = "Storage Blob Data Contributor"
112
- + resource "azurerm_role_assignment" "sa_export_inprogress" {
113
- + scope = azurerm_storage_account.sa_export_inprogress.id
114
- + role_definition_name = "Contributor"
115
- + principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
116
- + }
117
- +
118
- + resource "azurerm_role_assignment" "sa_export_rejected" {
119
- + scope = azurerm_storage_account.sa_export_rejected.id
120
- + role_definition_name = "Contributor"
121
- + principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
122
- + }
123
- +
124
- + resource "azurerm_role_assignment" "sa_export_blocked" {
125
- + scope = azurerm_storage_account.sa_export_blocked.id
126
- + role_definition_name = "Contributor"
127
- + principal_id = data.azurerm_user_assigned_identity.airlock_id.principal_id
128
- + }
129
- +
130
- +
131
- + resource "azurerm_role_assignment" "sa_import_approved_reader" {
132
- + scope = azurerm_storage_account.sa_import_approved.id
133
- + role_definition_name = "Reader and Data Access"
134
- + principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
135
- + }
136
- +
137
- +
138
- + resource "azurerm_role_assignment" "sa_export_internal_reader" {
139
- + scope = azurerm_storage_account.sa_export_internal.id
140
- + role_definition_name = "Reader and Data Access"
141
- + principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
142
- + }
143
- +
144
- + resource "azurerm_role_assignment" "sa_export_inprogress_reader" {
145
- + scope = azurerm_storage_account.sa_export_inprogress.id
146
- + role_definition_name = "Reader and Data Access"
147
- + principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
148
- + }
149
- +
150
- + resource "azurerm_role_assignment" "sa_export_rejected_reader" {
151
- + scope = azurerm_storage_account.sa_export_rejected.id
152
- + role_definition_name = "Reader and Data Access"
153
- principal_id = data.azurerm_user_assigned_identity.api_id.principal_id
154
- }
155
59
diff -Naur ../base/terraform/storage.tf terraform/storage.tf
156
60
--- ../base/terraform/storage.tf 2022-08-10 10:15:54.000000000 +0100
157
61
+++ terraform/storage.tf 2022-09-14 23:46:54.000000000 +0100
0 commit comments