-
Notifications
You must be signed in to change notification settings - Fork 0
/
migration-blob-storage.tf
72 lines (65 loc) · 3.52 KB
/
migration-blob-storage.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module "sa-migration-standard" {
count = local.is_migration_environment ? 1 : 0
source = "git@github.com:hmcts/cnp-module-storage-account?ref=master"
env = var.env
storage_account_name = "sa${var.env}${var.product}mig02"
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
location = var.location
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "ZRS"
containers = local.containers-mig
private_endpoint_subnet_id = resource.azurerm_subnet.migration[0].id
enable_nfs = true
enable_hns = true
enable_data_protection = true
enable_versioning = false
defender_enabled = var.defender_enable
defender_malware_scanning_enabled = var.defender_scan
defender_malware_scanning_cap_gb_per_month = 250000
common_tags = var.common_tags
}
moved {
from = module.sa-migration
to = module.sa-migration[0]
}
resource "azurerm_storage_blob" "migration-st" {
count = local.is_migration_environment ? 1 : 0
name = "${var.product}-migration-blob-st-${var.env}"
storage_account_name = module.sa-migration-standard[0].storageaccount_name
storage_container_name = local.darts_migration_container
type = "Block"
}
data "azurerm_subnet" "private_endpoints_dets" {
resource_group_name = local.private_endpoint_rg_name
virtual_network_name = local.private_endpoint_vnet_name
name = "private-endpoints"
}
module "sa-dets-standard" {
count = local.is_test_environment ? 1 : 0
source = "git@github.com:hmcts/cnp-module-storage-account?ref=master"
env = var.env
storage_account_name = "${var.env}dets${var.product}"
resource_group_name = azurerm_resource_group.darts_resource_group.name
location = var.location
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "ZRS"
containers = local.containers-mig
private_endpoint_subnet_id = data.azurerm_subnet.private_endpoints_dets.id
enable_nfs = true
enable_hns = true
enable_data_protection = true
enable_versioning = false
defender_enabled = var.defender_enable
defender_malware_scanning_enabled = var.defender_scan
defender_malware_scanning_cap_gb_per_month = 250000
common_tags = var.common_tags
}
resource "azurerm_storage_blob" "dets-st" {
count = local.is_test_environment ? 1 : 0
name = "${var.product}-dets-blob-st-${var.env}"
storage_account_name = module.sa-dets-standard[0].storageaccount_name
storage_container_name = local.darts_migration_container
type = "Block"
}