Skip to content

Commit a38866d

Browse files
authored
add sftp storage account (#2622)
https://trello.com/c/CMuoKrz8/1719-replace-globalscape-sftp-with-sftp-enabled-storage-container Create new sftp enabled storage account for trs that will be used for capita imports/exports & ewc imports. - Storage container(s) will be managed manually. - local sftp users will be managed manually. - IP Whitelisting will be managed manually, defaulted to **DENY** to prevent being publicly accessible.
1 parent 9a5860b commit a38866d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

terraform/aks/sftpstorage.tf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
resource "azurerm_storage_account" "sftp_storage" {
2+
name = "${var.azure_resource_prefix}${var.service_short_name}${var.environment_short_name}${var.app_name != null && var.app_name != "" ? var.app_name : ""}sftpsa"
3+
location = var.region
4+
resource_group_name = var.resource_group_name
5+
account_replication_type = var.environment_name != "production" ? "LRS" : "GRS"
6+
account_tier = "Standard"
7+
account_kind = "StorageV2"
8+
min_tls_version = "TLS1_2"
9+
infrastructure_encryption_enabled = true
10+
# Enable hierarchical namespace & SFTP
11+
is_hns_enabled = true
12+
sftp_enabled = true
13+
allow_nested_items_to_be_public = false
14+
15+
# Restrict access to allowed IPs
16+
network_rules {
17+
default_action = "Deny"
18+
bypass = ["AzureServices"]
19+
ip_rules = [
20+
]
21+
}
22+
blob_properties {
23+
last_access_time_enabled = true
24+
}
25+
lifecycle {
26+
ignore_changes = [
27+
tags
28+
]
29+
}
30+
}
31+
32+
# Enabling sftp on the sa prevents being able to create a storage container
33+
# because enabling hns/sftp switches to datalake api rather than blob storage api
34+
#
35+
# This container is created manually for now.
36+
#resource "azurerm_storage_container" "sftp_ewc" {
37+
# name = "ewc-integrations"
38+
# storage_account_name = azurerm_storage_account.sftp_storage.name
39+
# container_access_type = "private"
40+
#}

0 commit comments

Comments
 (0)