1+ data "aws_caller_identity" "identity" {}
2+
13terraform {
24 backend "s3" {
35 bucket = " ${ var . project_name } -${ var . environment } -tfstate"
@@ -26,10 +28,7 @@ module "networking" {
2628
2729 project_name = var. project_name
2830 environment = var. environment
29- vpc_cidr = var. vpc_cidr
3031 availability_zones = [" us-east-1a" , " us-east-1b" ]
31- public_subnet_cidrs = var. public_subnet_cidrs
32- private_subnet_cidrs = var. private_subnet_cidrs
3332 logging_key_id = module. logging . kms_key_arn
3433}
3534
@@ -41,10 +40,6 @@ module "database" {
4140 environment = var. environment
4241 subnet_ids = module. networking . private_subnet_ids
4342 security_group_id = module. networking . rds_security_group_id
44- instance_class = var. db_instance_class
45- allocated_storage = var. db_allocated_storage
46- db_name = var. db_name
47- db_username = var. db_username
4843}
4944
5045# Redis for Sidekiq
@@ -55,8 +50,6 @@ module "cache" {
5550 environment = var. environment
5651 subnet_ids = module. networking . private_subnet_ids
5752 security_group_id = module. networking . redis_security_group_id
58- node_type = var. redis_node_type
59- port = var. redis_port
6053}
6154
6255# Deployment resources (ECR, GitHub Actions, Secrets)
@@ -65,22 +58,10 @@ module "deployment" {
6558
6659 project_name = var. project_name
6760 environment = var. environment
68- github_repository = var. github_repository
6961
70- db_username = var. db_username
7162 db_password_secret_arn = module. database . db_password_secret_arn
72- db_endpoint = module. database . db_instance_endpoint
73- db_name = var. db_name
74- rails_master_key = var. rails_master_key
75- aws_account_id = var. aws_account_id
63+ aws_account_id = data. aws_caller_identity . identity . account_id
7664 backend_kms_arn = module. backend . kms_key
77- redis_url = format (" redis://%s:%s" ,
78- module. cache . redis_endpoint ,
79- module. cache . redis_port
80- )
81- secret_key_base = var. secret_key_base
82- google_ai_key = var. google_ai_key
83- anthropic_key = var. anthropic_key
8465 document_inference_lambda_arn = module. lambda . document_inference_lambda_arn
8566 document_inference_evaluation_lambda_arn = module. lambda . document_inference_evaluation_lambda_arn
8667 evaluation_lambda_arn = module. lambda . evaluation_lambda_arn
@@ -118,6 +99,14 @@ module "secrets" {
11899 secret_key = " "
119100 })
120101 }
102+ google = {
103+ description = " The Rails master key."
104+ name = " /asap-pdf/production/GOOGLE_AI_KEY"
105+ }
106+ anthropic = {
107+ description = " The Rails master key."
108+ name = " /asap-pdf/production/ANTHROPIC_KEY"
109+ }
121110 }
122111}
123112
@@ -162,8 +151,8 @@ module "lambda" {
162151 document_inference_ecr_repository_url = module. deployment . document_inference_ecr_repository_url
163152 evaluation_ecr_repository_url = module. deployment . evaluation_ecr_repository_url
164153 document_inference_evaluation_ecr_repository_url = module. deployment . document_inference_evaluation_ecr_repository_url
165- secret_google_ai_key_arn = module. deployment . gemini_key_secret_arn
166- secret_anthropic_key_arn = module. deployment . anthropic_key_secret_arn
154+ secret_google_ai_key_arn = module. secrets . secrets [ " google " ] . secret_arn
155+ secret_anthropic_key_arn = module. secrets . secrets [ " anthropic " ] . secret_arn
167156 s3_document_bucket_arn = aws_s3_bucket. documents . arn
168157}
169158
0 commit comments