Skip to content

Commit

Permalink
Few changes for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Valswyn-NHS committed Jan 15, 2025
1 parent 83744e3 commit 46865a5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions terraform/ack_lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ resource "aws_lambda_function" "ack_processor_lambda" {
}

reserved_concurrent_executions = 20
depends_on = [
aws_cloudwatch_log_group.ack_lambda_log_group
]
}

resource "aws_lambda_event_source_mapping" "sqs_to_lambda"{
Expand Down
4 changes: 2 additions & 2 deletions terraform/api_gateway/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ resource "aws_apigatewayv2_stage" "default" {

default_route_settings {
logging_level = "INFO"
throttling_burst_limit = 100
throttling_rate_limit = 100
throttling_burst_limit = 500
throttling_rate_limit = 500
detailed_metrics_enabled = true
}
access_log_settings {
Expand Down
2 changes: 1 addition & 1 deletion terraform/api_gateway/logs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_cloudwatch_log_group" "api_access_log" {
name = "/aws/vendedlogs/${aws_apigatewayv2_api.service_api.id}/${local.api_stage_name}"
retention_in_days = 7
retention_in_days = 30
}

resource "aws_api_gateway_account" "api_account" {
Expand Down
8 changes: 6 additions & 2 deletions terraform/file_name_processor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ resource "aws_iam_policy" "filenameprocessor_lambda_exec_policy" {
Effect = "Allow"
Action = "lambda:InvokeFunction"
Resource = [
"${data.aws_lambda_function.existing_file_name_proc_lambda.arn}",
"arn:aws:lambda:${var.aws_region}:${local.local_account_id}:function:imms-${local.env}-filenameproc_lambda",
]
}
]
Expand Down Expand Up @@ -295,6 +295,10 @@ resource "aws_lambda_function" "file_processor_lambda" {
}
kms_key_arn = data.aws_kms_key.existing_lambda_encryption_key.arn
reserved_concurrent_executions = 20
depends_on = [
aws_cloudwatch_log_group.file_name_processor_log_group,
aws_iam_policy.filenameprocessor_lambda_exec_policy
]

}

Expand Down Expand Up @@ -414,7 +418,7 @@ resource "aws_iam_role_policy_attachment" "elasticache_policy_attachment" {
policy_arn = aws_iam_policy.elasticache_permissions.arn
}

resource "aws_cloudwatch_log_group" "file_name_processor_lambdalog_group" {
resource "aws_cloudwatch_log_group" "file_name_processor_log_group" {
name = "/aws/lambda/${local.short_prefix}-filenameproc_lambda"
retention_in_days = 30
}
4 changes: 3 additions & 1 deletion terraform/forwarder_lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ resource "aws_lambda_function" "forwarding_lambda" {
}
kms_key_arn = data.aws_kms_key.existing_lambda_encryption_key.arn
depends_on = [
aws_iam_role_policy_attachment.forwarding_lambda_exec_policy_attachment
aws_iam_role_policy_attachment.forwarding_lambda_exec_policy_attachment,
aws_cloudwatch_log_group.forwarding_lambda_log_group
]

reserved_concurrent_executions = 20
}

Expand Down
1 change: 1 addition & 0 deletions terraform/splunk/firehose.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ resource "aws_kinesis_firehose_delivery_stream" "splunk_firehose_stream" {

resource "aws_cloudwatch_log_group" "fire_house_logs" {
name = "${local.prefix}-firehose-logs"
retention_in_days = 30
}

resource "aws_cloudwatch_log_stream" "splunk_logs_stream" {
Expand Down

0 comments on commit 46865a5

Please sign in to comment.