diff --git a/README.md b/README.md index 2cc0610..f3207b3 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ db_storage = "120" alb_ssl_policy = "ELBSecurityPolicy-2016-08" alb_certificate_arn = "arn:aws:acm:us-east-1:290379793816:certificate/6d1bab74-fb46-4244-aab2-832bf519ab24" root_block_size = 120 +pool_size = 30 ``` - The region should be left at `us-east-1` as some of the other regions fail for different reasons. @@ -126,6 +127,7 @@ root_block_size = 120 - If you don't plan to use SSL, set variable `use_ssl = "false"` - The `alb_ssl_policy` and `alb_certificate_arn` are required in order to force SSL usage. - The `root_block_size` is the amount of storage on your EC2 instance. This value can be adjusted by how frequently logs are rotated. Logs are located in `/opt/app/logs` of your EC2 instance. +- The `pool_size` defines the number of connections allowed by the RDS instance. ## Database Storage Required diff --git a/main/main.tf b/main/main.tf index 11a85c0..956e5cf 100644 --- a/main/main.tf +++ b/main/main.tf @@ -28,6 +28,7 @@ module "stack" { public_subnet_cidr = "${var.public_subnet_cidr}" instance_type = "${var.instance_type}" root_block_size = "${var.root_block_size}" + pool_size = "${var.pool_size}" db_subnet_cidr = "${var.db_subnet_cidr}" dns_zone_name = "${var.dns_zone_name}" diff --git a/main/variables.tf b/main/variables.tf index 573d1ab..a624285 100644 --- a/main/variables.tf +++ b/main/variables.tf @@ -33,6 +33,11 @@ variable "root_block_size" { default = 8 } +variable "pool_size" { + description = "The number of connections available to the RDS instance" + default = 30 +} + variable "chains" { description = "A map of chain names to urls" default = { diff --git a/modules/stack/config.tf b/modules/stack/config.tf index 87d470b..16c1752 100644 --- a/modules/stack/config.tf +++ b/modules/stack/config.tf @@ -15,7 +15,7 @@ resource "aws_ssm_parameter" "new_relic_license_key" { resource "aws_ssm_parameter" "pool_size" { count = "${length(var.chains)}" name = "/${var.prefix}/${element(keys(var.chains),count.index)}/pool_size" - value = "10" + value = "${var.pool_size}" type = "String" } diff --git a/modules/stack/variables.tf b/modules/stack/variables.tf index fafa050..74e71a5 100644 --- a/modules/stack/variables.tf +++ b/modules/stack/variables.tf @@ -7,6 +7,7 @@ variable "db_subnet_cidr" {} variable "dns_zone_name" {} variable "instance_type" {} variable "root_block_size" {} +variable "pool_size" {} variable "chain_jsonrpc_variant" { default = {} diff --git a/terraform.tfvars.example b/terraform.tfvars.example index eb9dfee..1d940f6 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -8,4 +8,5 @@ db_instance_class = "db.m4.xlarge" db_storage = "120" alb_ssl_policy = "ELBSecurityPolicy-2016-08" alb_certificate_arn = "arn:aws:acm:us-east-1:290379793816:certificate/6d1bab74-fb46-4244-aab2-832bf519ab24" -root_block_size = 120 \ No newline at end of file +root_block_size = 120 +pool_size = 30 \ No newline at end of file