Skip to content

Commit

Permalink
Merge pull request #25 from SumoLogic/cw-dlq
Browse files Browse the repository at this point in the history
Updating cw dlq nodejs runtime
  • Loading branch information
himsharma01 authored Oct 25, 2023
2 parents e2d42e8 + 1464ad6 commit b7722c6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
8 changes: 4 additions & 4 deletions aws/cloudwatchlogsforwarder/cloudwatchlogsforwarder.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ resource "aws_iam_role_policy_attachment" "invoke_lambda_policy_attachment" {
resource "aws_lambda_function" "logs_lambda_function" {
function_name = "SumoCWLogsLambda-${random_string.aws_random.id}"
handler = "cloudwatchlogs_lambda.handler"
runtime = "nodejs14.x"
runtime = "nodejs18.x"
role = aws_iam_role.lambda_iam_role.arn
s3_bucket = "appdevzipfiles-${local.aws_region}"
s3_key = "cloudwatchlogs-with-dlq.zip"
s3_key = "cloudwatchLogsDLQ/v1.2.0/cloudwatchlogs-with-dlq.zip"
timeout = 300
memory_size = 128
dead_letter_config {
Expand All @@ -103,10 +103,10 @@ resource "aws_lambda_function" "logs_lambda_function" {
resource "aws_lambda_function" "process_dead_letter_queue_lambda" {
function_name = "SumoCWProcessDLQLambda-${random_string.aws_random.id}"
handler = "DLQProcessor.handler"
runtime = "nodejs14.x"
runtime = "nodejs18.x"
role = aws_iam_role.lambda_iam_role.arn
s3_bucket = "appdevzipfiles-${local.aws_region}"
s3_key = "cloudwatchlogs-with-dlq.zip"
s3_key = "cloudwatchLogsDLQ/v1.2.0/cloudwatchlogs-with-dlq.zip"
timeout = 300
memory_size = 128
dead_letter_config {
Expand Down
22 changes: 15 additions & 7 deletions aws/kinesisfirehoseforlogs/kinesisfirehoseforlogs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ resource "aws_s3_bucket" "s3_bucket" {

bucket = local.bucket_name
force_destroy = var.bucket_details.force_destroy_bucket
acl = "private"
# acl = "private"
}

# Default s3 bucket acl is private, if you want to update uncomment the following block
# For more details refer https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl
# resource "aws_s3_bucket_acl" "s3_bucket_acl" {
# for_each = toset(local.create_bucket ? ["s3_bucket_acl"] : [])
# bucket = aws_s3_bucket.s3_bucket["s3_bucket"].id
# acl = "private"
# }

resource "aws_s3_bucket_public_access_block" "s3_bucket_access_block" {
for_each = toset(local.create_bucket ? ["s3_bucket_access_block"] : [])

Expand Down Expand Up @@ -115,12 +123,7 @@ resource "aws_kinesis_firehose_delivery_stream" "logs_delivery_stream" {
log_stream_name = aws_cloudwatch_log_stream.http_log_stream.name
}

request_configuration {
content_encoding = "GZIP"
}
}

s3_configuration {
s3_configuration {
role_arn = aws_iam_role.firehose_role.arn
bucket_arn = "arn:${local.arn_map[local.aws_region]}:s3:::${local.bucket_name}"
compression_format = "UNCOMPRESSED"
Expand All @@ -131,6 +134,11 @@ resource "aws_kinesis_firehose_delivery_stream" "logs_delivery_stream" {
log_stream_name = aws_cloudwatch_log_stream.s3_log_stream.name
}
}

request_configuration {
content_encoding = "GZIP"
}
}
}

resource "aws_cloudwatch_log_subscription_filter" "delivery_stream_subscription" {
Expand Down
2 changes: 1 addition & 1 deletion aws/kinesisfirehoseforlogs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.42.0"
version = ">= 5.16.2, < 6.0.0"
}
sumologic = {
version = ">= 2.9.0"
Expand Down
14 changes: 11 additions & 3 deletions aws/kinesisfirehoseformetrics/kinesisfirehoseformetrics.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ resource "aws_s3_bucket" "s3_bucket" {

bucket = local.bucket_name
force_destroy = var.bucket_details.force_destroy_bucket
acl = "private"
# acl = "private"
}

# Default s3 bucket acl is private, if you want to update uncomment the following block
# For more details refer https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl
# resource "aws_s3_bucket_acl" "s3_bucket_acl" {
# for_each = toset(local.create_bucket ? ["s3_bucket_acl"] : [])
# bucket = aws_s3_bucket.s3_bucket["s3_bucket"].id
# acl = "private"
# }

resource "aws_s3_bucket_public_access_block" "s3_bucket_access_block" {
for_each = toset(local.create_bucket ? ["s3_bucket_access_block"] : [])

Expand Down Expand Up @@ -116,9 +124,8 @@ resource "aws_kinesis_firehose_delivery_stream" "metrics_delivery_stream" {
request_configuration {
content_encoding = "GZIP"
}
}

s3_configuration {
s3_configuration {
role_arn = aws_iam_role.firehose_role.arn
bucket_arn = "arn:${local.arn_map[local.aws_region]}:s3:::${local.bucket_name}"
compression_format = "UNCOMPRESSED"
Expand All @@ -129,6 +136,7 @@ resource "aws_kinesis_firehose_delivery_stream" "metrics_delivery_stream" {
log_stream_name = aws_cloudwatch_log_stream.s3_log_stream.name
}
}
}
}

resource "aws_cloudwatch_metric_stream" "metric_stream" {
Expand Down
2 changes: 1 addition & 1 deletion aws/kinesisfirehoseformetrics/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.42.0"
version = ">= 5.16.2, < 6.0.0"
}
sumologic = {
version = ">= 2.9.0"
Expand Down

0 comments on commit b7722c6

Please sign in to comment.