diff --git a/env/.test.env b/env/.test.env index 96d92cd..fc448ad 100644 --- a/env/.test.env +++ b/env/.test.env @@ -24,8 +24,3 @@ THROTTLER_NAME=THROTTLER THROTTLER_TTL=60000 THROTTLER_LIMIT=10 -## MAILGUN -MAILGUN_API_KEY=5a7a101a34138a00e20683e3fcb07f23-7ecaf6b5-b7bae0b8 -MAILGUN_USER_NAME=api -MAILGUN_FROM=LUPPA -MAILGUN_EMAIL_DOMAIN=mg.wocex.io diff --git a/src/app.module.ts b/src/app.module.ts index 814a42c..53ab41f 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -12,7 +12,6 @@ import { JwtAuthGuard } from './common/guards/jwt-auth.guard'; import { APP_GUARD } from '@nestjs/core'; import { PersonaModule } from './modules/persona/persona.module'; import { MasterTablesModule } from './modules/master-tables/master-tables.module'; -import mailgunConfig from './config/mailgun.config'; import { TypeOrmModule } from '@nestjs/typeorm'; import { LoanInformationModule } from './modules/loan-information/loan-information.module'; import { MortgageInformationModule } from './modules/mortgage-information/mortgage-information.module'; @@ -48,13 +47,7 @@ import { BridgeLoanModule } from './modules/bridge-loan/bridge-loan.module'; imports: [ ConfigModule.forRoot({ envFilePath: `./env/.${process.env.NODE_ENV}.env`, - load: [ - serverConfig, - databaseConfig, - jwtConfig, - throttlerConfig, - mailgunConfig, - ], + load: [serverConfig, databaseConfig, jwtConfig, throttlerConfig], isGlobal: true, }), TypeOrmModule.forRootAsync({ diff --git a/src/common/services/mail/mail.service.ts b/src/common/services/mail/mail.service.ts index 484397d..aa93076 100644 --- a/src/common/services/mail/mail.service.ts +++ b/src/common/services/mail/mail.service.ts @@ -13,8 +13,8 @@ export class MailService { constructor(private configService: ConfigService) { const mailgun = new Mailgun(FormData); this.clientMailGun = mailgun.client({ - username: this.configService.get('mailgun.userName'), - key: this.configService.get('mailgun.key'), + username: 'username', //this.configService.get('mailgun.userName'), + key: 'key', //this.configService.get('mailgun.key'), }); } diff --git a/src/config/mailgun.config.ts b/src/config/mailgun.config.ts deleted file mode 100644 index d591eae..0000000 --- a/src/config/mailgun.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { registerAs } from '@nestjs/config'; - -export default registerAs('mailgun', () => ({ - key: process.env.MAILGUN_API_KEY, - userName: process.env.MAILGUN_USER_NAME, - from: process.env.MAILGUN_FROM, - domain: process.env.MAILGUN_EMAIL_DOMAIN, -})); diff --git a/terraform/fuap-backend/load_balancer.tf b/terraform/fuap-backend/load_balancer.tf index f7995a3..de95df2 100644 --- a/terraform/fuap-backend/load_balancer.tf +++ b/terraform/fuap-backend/load_balancer.tf @@ -1,56 +1,56 @@ -# Load Balancer (ALB) -resource "aws_lb" "main" { - name = "fuap-app-dev-alb" - internal = false - load_balancer_type = "application" - security_groups = [ - aws_security_group.lb.id, - ] - - subnet_mapping { - subnet_id = aws_subnet.public_a.id # Reemplaza con el ID de la subred pública donde se ubicará el ALB - } - - subnet_mapping { - subnet_id = aws_subnet.public_b.id # Subred en AZ B - } - - tags = { - Name = "fuap-app-dev-alb" - } -} - -# Target Group -resource "aws_lb_target_group" "main" { - name = "fuap-app-dev-target-group" - port = 3000 # Puerto donde escucha tu aplicación (por ejemplo, NestJS) - protocol = "HTTP" - target_type = "ip" - - vpc_id = aws_vpc.main.id # Reemplaza con el ID de tu VPC - - health_check { - path = "/api/docs" - protocol = "HTTP" - timeout = 5 - interval = 30 - healthy_threshold = 2 - unhealthy_threshold = 2 - } - - tags = { - Name = "fuap-app-dev-target-group" - } -} - -# Listener -resource "aws_lb_listener" "main" { - load_balancer_arn = aws_lb.main.arn - port = "80" - protocol = "HTTP" - - default_action { - type = "forward" - target_group_arn = aws_lb_target_group.main.arn - } -} +# # Load Balancer (ALB) +# resource "aws_lb" "main" { +# name = "fuap-app-dev-alb" +# internal = false +# load_balancer_type = "application" +# security_groups = [ +# aws_security_group.lb.id, +# ] + +# subnet_mapping { +# subnet_id = aws_subnet.public_a.id # Reemplaza con el ID de la subred pública donde se ubicará el ALB +# } + +# subnet_mapping { +# subnet_id = aws_subnet.public_b.id # Subred en AZ B +# } + +# tags = { +# Name = "fuap-app-dev-alb" +# } +# } + +# # Target Group +# resource "aws_lb_target_group" "main" { +# name = "fuap-app-dev-target-group" +# port = 3000 # Puerto donde escucha tu aplicación (por ejemplo, NestJS) +# protocol = "HTTP" +# target_type = "ip" + +# vpc_id = aws_vpc.main.id # Reemplaza con el ID de tu VPC + +# health_check { +# path = "/api/docs" +# protocol = "HTTP" +# timeout = 5 +# interval = 30 +# healthy_threshold = 2 +# unhealthy_threshold = 2 +# } + +# tags = { +# Name = "fuap-app-dev-target-group" +# } +# } + +# # Listener +# resource "aws_lb_listener" "main" { +# load_balancer_arn = aws_lb.main.arn +# port = "80" +# protocol = "HTTP" + +# default_action { +# type = "forward" +# target_group_arn = aws_lb_target_group.main.arn +# } +# } diff --git a/terraform/fuap-backend/security_groups.tf b/terraform/fuap-backend/security_groups.tf index 5adde69..c65850a 100644 --- a/terraform/fuap-backend/security_groups.tf +++ b/terraform/fuap-backend/security_groups.tf @@ -41,30 +41,30 @@ resource "aws_security_group" "rds" { } } -resource "aws_security_group" "lb" { - vpc_id = aws_vpc.main.id - tags = { - Name = "lb-sg" - } +# resource "aws_security_group" "lb" { +# vpc_id = aws_vpc.main.id +# tags = { +# Name = "lb-sg" +# } - ingress { - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } +# ingress { +# from_port = 80 +# to_port = 80 +# protocol = "tcp" +# cidr_blocks = ["0.0.0.0/0"] +# } - ingress { - from_port = 4433 - to_port = 4433 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } +# ingress { +# from_port = 4433 +# to_port = 4433 +# protocol = "tcp" +# cidr_blocks = ["0.0.0.0/0"] +# } - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} +# egress { +# from_port = 0 +# to_port = 0 +# protocol = "-1" +# cidr_blocks = ["0.0.0.0/0"] +# } +# } diff --git a/terraform/fuap-backend/variables.tf b/terraform/fuap-backend/variables.tf index e59dbfb..f8daa38 100644 --- a/terraform/fuap-backend/variables.tf +++ b/terraform/fuap-backend/variables.tf @@ -46,7 +46,6 @@ variable "db_engine" { default = "postgres" } - variable "db_username" { description = "User developer" type = string