Skip to content

Commit a14e8ee

Browse files
authored
Merge pull request #16255 from CDCgov/ms/devsecops/tf-timeouts
adding sftp timeouts, addressing some drift
2 parents 2bc83f9 + 040c7f5 commit a14e8ee

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

operations/app/terraform/modules/sftp/storage.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ resource "azurerm_storage_account" "sftp" {
77
account_replication_type = "GRS"
88
min_tls_version = "TLS1_2"
99
allow_nested_items_to_be_public = false
10+
large_file_share_enabled = false
1011

1112
network_rules {
1213
default_action = "Allow"
@@ -19,20 +20,41 @@ resource "azurerm_storage_account" "sftp" {
1920
tags = {
2021
environment = var.environment
2122
}
23+
24+
timeouts {
25+
create = var.timeout_create
26+
read = var.timeout_read
27+
delete = var.timeout_delete
28+
update = var.timeout_update
29+
}
2230
}
2331

2432
# SSH host keys share
2533
resource "azurerm_storage_share" "sftp_admin" {
2634
name = "${var.resource_prefix}-sftp-admin-share"
2735
storage_account_name = azurerm_storage_account.sftp.name
2836
quota = 1
37+
38+
timeouts {
39+
create = var.timeout_create
40+
read = var.timeout_read
41+
delete = var.timeout_delete
42+
update = var.timeout_update
43+
}
2944
}
3045

3146
# SFTP startup scripts share
3247
resource "azurerm_storage_share" "sftp_scripts" {
3348
name = "${var.resource_prefix}-sftp-scripts-share"
3449
storage_account_name = azurerm_storage_account.sftp.name
3550
quota = 1
51+
52+
timeouts {
53+
create = var.timeout_create
54+
read = var.timeout_read
55+
delete = var.timeout_delete
56+
update = var.timeout_update
57+
}
3658
}
3759

3860
# SFTP startup script

operations/app/terraform/modules/sftp/~inputs.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,28 @@ variable "sshinstances" {
6060
variable "sftp_dir" {
6161
description = "SFTP Script Directory"
6262
}
63+
64+
# TF timeouts for storage operations
65+
variable "timeout_create" {
66+
description = "Timeout for create operations"
67+
type = string
68+
default = "60m" # module default 30m
69+
}
70+
71+
variable "timeout_read" {
72+
description = "Timeout for read operations"
73+
type = string
74+
default = "60m" # module default 5m
75+
}
76+
77+
variable "timeout_update" {
78+
description = "Timeout for update operations"
79+
type = string
80+
default = "60m" # module default 30m
81+
}
82+
83+
variable "timeout_delete" {
84+
description = "Timeout for delete operations"
85+
type = string
86+
default = "60m" # module default 30m
87+
}

operations/app/terraform/modules/storage/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ resource "azurerm_storage_account" "storage_public" {
175175
allow_nested_items_to_be_public = false
176176
https_traffic_only_enabled = true
177177
local_user_enabled = false
178+
large_file_share_enabled = false
178179

179180
static_website {
180181
index_document = "index.html"

0 commit comments

Comments
 (0)