Skip to content

Commit

Permalink
chore: update config
Browse files Browse the repository at this point in the history
  • Loading branch information
Oluwatunmise-olat committed Jan 30, 2024
1 parent 2fbb94f commit 9f4c65a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion infra/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module "serverless_module" {
aws_preexisting_ecr = var.aws_preexisting_ecr
source = "./serverless"
source = "./serverless"
}
3 changes: 3 additions & 0 deletions infra/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "serverless_module" {
value = module.serverless_module
}
12 changes: 9 additions & 3 deletions infra/serverless/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
///////////// DynamoDB ///////////////////
//////////////////////////////////////////
resource "aws_dynamodb_table" "audio_sync" {
name = "audio_sync_x"
name = "audio_sync_x" // <- Name should align with code
billing_mode = "PAY_PER_REQUEST"
hash_key = "video_id"

Expand All @@ -16,7 +16,7 @@ resource "aws_dynamodb_table" "audio_sync" {
///////////// Create S3 Bucket ///////////
//////////////////////////////////////////
resource "aws_s3_bucket" "audio_sync_s3" {
bucket = "audio-sync-s3-bucket-prem"
bucket = "audio-sync-s3-bucket-prem" // <- Bucket name should align with code
force_destroy = true
}

Expand Down Expand Up @@ -64,7 +64,7 @@ resource "aws_sqs_queue" "audio_sync_fifo_queue" {
//////////////////////////////////////////
resource "aws_ecr_repository" "audio_sync_ecr" {
name = "audio_sync"
image_tag_mutability = "IMMUTABLE"
image_tag_mutability = "MUTABLE"

image_scanning_configuration {
scan_on_push = true
Expand Down Expand Up @@ -122,6 +122,12 @@ resource "aws_lambda_function" "audio_sync_lambda_function" {
memory_size = 1024
timeout = 900
role = aws_iam_role.lambda_role.arn
environment {
variables = {
"SES_SENDER_MAIL" = "[email protected]" // <- use your verified email address,
"SQS_URL" = aws_sqs_queue.audio_sync_fifo_queue.url
}
}

logging_config {
log_format = "JSON"
Expand Down
8 changes: 4 additions & 4 deletions src/shared/validations/conf.validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Joi } from "celebrate";

export const configRule = Joi.object({
/** Aws Configs */
SES_PASSWORD: Joi.string().required(),
SES_USERNAME: Joi.string().required(),
SES_PASSWORD: Joi.string().optional(),
SES_USERNAME: Joi.string().optional(),
SES_SENDER_MAIL: Joi.string().required(),
SECRET_ACCESS_KEY: Joi.string().required(),
ACCESS_KEY_ID: Joi.string().required(),
SECRET_ACCESS_KEY: Joi.string().optional(),
ACCESS_KEY_ID: Joi.string().optional(),
AWS_REGION: Joi.string().required(),
SQS_URL: Joi.string().required(),

Expand Down

0 comments on commit 9f4c65a

Please sign in to comment.