From 19e16f137b108aa878d23027cbdfae16091ca9ce Mon Sep 17 00:00:00 2001 From: Nicholas Kumia Date: Tue, 5 Jul 2022 11:00:48 -0400 Subject: [PATCH 1/4] feat: configure provisioning EFS throughput To support higher workload operations, allow users to specify the throughput for the EFS volume. Reference: https://docs.aws.amazon.com/efs/latest/ug/performance.html#throughput-modes --- solr-on-ecs.yml | 8 ++++++++ terraform/standalone_ecs/provision/efs.tf | 4 ++++ terraform/standalone_ecs/provision/variables.tf | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/solr-on-ecs.yml b/solr-on-ecs.yml index c7c3356..8aa3e7d 100644 --- a/solr-on-ecs.yml +++ b/solr-on-ecs.yml @@ -39,6 +39,10 @@ provision: required: false type: string details: "The Solr setup file for initialization of cores/authentication/et cetera..." + - field_name: efsProvisionedThroughput + required: false + type: number + details: "The throughput, measured in MiB/s, that you want to provision for the file system" computed_inputs: - name: instance_name type: string @@ -70,6 +74,10 @@ provision: default: "https://raw.githubusercontent.com/GSA/catalog.data.gov/main/solr/solr_setup.sh" overwrite: false type: string + - name: efsProvisionedThroughput + default: 100 + overwrite: false + type: number - name: region type: string details: "The AWS region in which to create k8s instances" diff --git a/terraform/standalone_ecs/provision/efs.tf b/terraform/standalone_ecs/provision/efs.tf index 03ba95f..d1f68a8 100644 --- a/terraform/standalone_ecs/provision/efs.tf +++ b/terraform/standalone_ecs/provision/efs.tf @@ -21,6 +21,10 @@ resource "aws_kms_key" "solr-data-key" { resource "aws_efs_file_system" "solr-data" { creation_token = "solr-${local.id_64char}-data" + performance_mode = "generalPurpose" + throughput_moe = "provisioned" + provisioned_throughput_in_mibps = var.efsProvisionedThroughput + # encryption-at-rest encrypted = true kms_key_id = aws_kms_key.solr-data-key.arn diff --git a/terraform/standalone_ecs/provision/variables.tf b/terraform/standalone_ecs/provision/variables.tf index 988d780..0e556b8 100644 --- a/terraform/standalone_ecs/provision/variables.tf +++ b/terraform/standalone_ecs/provision/variables.tf @@ -49,3 +49,9 @@ variable "setupLink" { description = "The Solr setup file for initialization of cores/authentication/et cetera..." default = "https://raw.githubusercontent.com/GSA/catalog.data.gov/main/solr/solr_setup.sh" } + +variable "efsProvisionedThroughput" { + type = number + description = "The throughput, measured in MiB/s, that you want to provision for the file system" + default = 100 +} From 7eafd43e96be2f9e021798e9a1641fd459cbe6c8 Mon Sep 17 00:00:00 2001 From: Nicholas Kumia Date: Tue, 5 Jul 2022 11:10:10 -0400 Subject: [PATCH 2/4] fix: make private dns name unique In the AWS Console, in Route53, there were/are a bunch of 'local' domains that are indistinguishable from each other even though they refer to separate domains. This helps to make them more human-readable --- terraform/standalone_ecs/provision/vpc.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/standalone_ecs/provision/vpc.tf b/terraform/standalone_ecs/provision/vpc.tf index f76a10b..934d091 100644 --- a/terraform/standalone_ecs/provision/vpc.tf +++ b/terraform/standalone_ecs/provision/vpc.tf @@ -27,7 +27,7 @@ module "vpc" { } resource "aws_service_discovery_private_dns_namespace" "solr" { - name = "local" + name = "solr${local.lb_name}" description = "Internal solr-to-solr communication link" vpc = module.vpc.vpc_id } From 0b7d571df4781fc0fd2a5cfab1288c6daebac1f8 Mon Sep 17 00:00:00 2001 From: Nicholas Kumia Date: Tue, 5 Jul 2022 11:17:54 -0400 Subject: [PATCH 3/4] fix: typo throughput_mode --- terraform/standalone_ecs/provision/efs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/standalone_ecs/provision/efs.tf b/terraform/standalone_ecs/provision/efs.tf index d1f68a8..9238a64 100644 --- a/terraform/standalone_ecs/provision/efs.tf +++ b/terraform/standalone_ecs/provision/efs.tf @@ -22,7 +22,7 @@ resource "aws_efs_file_system" "solr-data" { creation_token = "solr-${local.id_64char}-data" performance_mode = "generalPurpose" - throughput_moe = "provisioned" + throughput_mode = "provisioned" provisioned_throughput_in_mibps = var.efsProvisionedThroughput # encryption-at-rest From 2bb1dc97a1a1f63854c4bb8842da517304290001 Mon Sep 17 00:00:00 2001 From: Nicholas Kumia Date: Tue, 5 Jul 2022 11:23:16 -0400 Subject: [PATCH 4/4] new: default to lower efs provisioned throughput --- solr-on-ecs.yml | 2 +- terraform/standalone_ecs/provision/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/solr-on-ecs.yml b/solr-on-ecs.yml index 8aa3e7d..50b43b5 100644 --- a/solr-on-ecs.yml +++ b/solr-on-ecs.yml @@ -75,7 +75,7 @@ provision: overwrite: false type: string - name: efsProvisionedThroughput - default: 100 + default: 1 overwrite: false type: number - name: region diff --git a/terraform/standalone_ecs/provision/variables.tf b/terraform/standalone_ecs/provision/variables.tf index 0e556b8..8bf9f79 100644 --- a/terraform/standalone_ecs/provision/variables.tf +++ b/terraform/standalone_ecs/provision/variables.tf @@ -53,5 +53,5 @@ variable "setupLink" { variable "efsProvisionedThroughput" { type = number description = "The throughput, measured in MiB/s, that you want to provision for the file system" - default = 100 + default = 1 }