@@ -135,19 +135,33 @@ module "alb" {
135135 tg_api_arn = module. tg_api . tg_arn
136136}
137137
138+ # Setup EFS Files storage
139+ module "efs_files" {
140+ source = " ../../modules/EFS"
141+ environment = var. environment
142+ app_name = var. app_name
143+ name = var. efs_config . files_dir
144+ purpose = " Temporary file storage when accessing court files."
145+ subnet_ids = module. subnets . app_subnets_ids
146+ security_group_ids = [data . aws_security_group . app_sg . id ]
147+ kms_key_arn = module. initial . kms_key_arn
148+ }
149+
138150# Create Lambda Functions
139151module "lambda" {
140- source = " ../../modules/Lambda"
141- environment = var. environment
142- app_name = var. app_name
143- lambda_role_arn = module. iam . lambda_role_arn
144- apigw_execution_arn = module. apigw . apigw_execution_arn
145- lambda_ecr_repo_url = module. initial . lambda_ecr . ecr_repo_url
146- lambda_memory_size = var. lambda_memory_size
147- subnet_ids = module. subnets . all_subnet_ids
148- sg_ids = [data . aws_security_group . web_sg . id , data . aws_security_group . data_sg . id , data . aws_security_group . app_sg . id ]
149- lambda_secrets = module. secrets_manager . lambda_secrets
150- ecs_cluster_name = module. ecs_cluster . ecs_cluster . name
152+ source = " ../../modules/Lambda"
153+ environment = var. environment
154+ app_name = var. app_name
155+ lambda_role_arn = module. iam . lambda_role_arn
156+ apigw_execution_arn = module. apigw . apigw_execution_arn
157+ lambda_ecr_repo_url = module. initial . lambda_ecr . ecr_repo_url
158+ lambda_memory_size = var. lambda_memory_size
159+ subnet_ids = module. subnets . all_subnet_ids
160+ sg_ids = [data . aws_security_group . web_sg . id , data . aws_security_group . data_sg . id , data . aws_security_group . app_sg . id ]
161+ lambda_secrets = module. secrets_manager . lambda_secrets
162+ ecs_cluster_name = module. ecs_cluster . ecs_cluster . name
163+ efs_access_point_arn = module. efs_files . access_point_arn
164+ efs_mount_path = var. efs_config . mount_path
151165}
152166
153167# Create Cloudwatch LogGroups
@@ -266,6 +280,13 @@ module "ecs_api_td" {
266280 log_group_name = module. ecs_api_td_log_group . log_group . name
267281 cpu = var. api_ecs_config . cpu
268282 memory_size = var. api_ecs_config . memory_size
283+ efs_volume_config = {
284+ name = " efs-files-storage"
285+ file_system_id = module.efs_files.efs_id
286+ access_point_id = module.efs_files.access_point_id
287+ root_directory = var.efs_config.files_dir
288+ container_path = var.efs_config.mount_path
289+ }
269290}
270291
271292# Create Web ECS Service
0 commit comments