Skip to content

Commit 24594d9

Browse files
added timeout as variable
1 parent ccdf9ee commit 24594d9

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module proxy {
3737
| Name | Description | Type | Default | Required |
3838
|------|-------------|:----:|:-----:|:-----:|
3939
| ami | The EC2 image ID to launch. | string | `""` | no |
40+
| connection\_timeout | Database connection timeout. | number | `"10"` | no |
4041
| cpu\_credits | The credit option for CPU usage \(unlimited or standard\) | string | `"standart"` | no |
4142
| docker\_compose\_version | Version of docker-compose to install. | string | `"1.25.0"` | no |
4243
| expiredate | In hours when access should expire. | string | `"100h"` | no |

cloud-init.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ data template_cloudinit_config express {
2121
nginx_content = base64gzip(templatefile("${path.module}/templates/nginx.conf", {
2222
sql_server_fqdn = var.sql_server_fqdn
2323
sql_server_port = var.sql_server_port
24+
timeout = var.connection_timout
2425
}))
2526
html_content = base64gzip(templatefile("${path.module}/templates/index.html", {
2627
name = var.name

templates/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ stream {
1414
server {
1515
listen ${sql_server_port};
1616
proxy_pass sqlvm;
17-
proxy_connect_timeout 1s;
17+
proxy_connect_timeout ${timeout}s;
1818
}
1919
}
2020
http {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,10 @@ variable "sql_server_port" {
8686
type = number
8787
description = "User name with home dictory."
8888
default = 1433
89+
}
90+
91+
variable "connection_timeout" {
92+
type = number
93+
description = "Database connection timeout."
94+
default = 10
8995
}

0 commit comments

Comments
 (0)