diff --git a/aws/cloudwatchlogsforwarder/cloudwatchlogsforwarder.tf b/aws/cloudwatchlogsforwarder/cloudwatchlogsforwarder.tf index c81f250..822fca8 100644 --- a/aws/cloudwatchlogsforwarder/cloudwatchlogsforwarder.tf +++ b/aws/cloudwatchlogsforwarder/cloudwatchlogsforwarder.tf @@ -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 { @@ -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 { diff --git a/aws/kinesisfirehoseforlogs/kinesisfirehoseforlogs.tf b/aws/kinesisfirehoseforlogs/kinesisfirehoseforlogs.tf index 85a4a15..0d55f0a 100644 --- a/aws/kinesisfirehoseforlogs/kinesisfirehoseforlogs.tf +++ b/aws/kinesisfirehoseforlogs/kinesisfirehoseforlogs.tf @@ -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"] : []) @@ -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" @@ -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" { diff --git a/aws/kinesisfirehoseforlogs/versions.tf b/aws/kinesisfirehoseforlogs/versions.tf index 2998b02..76ab42d 100644 --- a/aws/kinesisfirehoseforlogs/versions.tf +++ b/aws/kinesisfirehoseforlogs/versions.tf @@ -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" diff --git a/aws/kinesisfirehoseformetrics/kinesisfirehoseformetrics.tf b/aws/kinesisfirehoseformetrics/kinesisfirehoseformetrics.tf index 9aeb4d4..18c15f3 100644 --- a/aws/kinesisfirehoseformetrics/kinesisfirehoseformetrics.tf +++ b/aws/kinesisfirehoseformetrics/kinesisfirehoseformetrics.tf @@ -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"] : []) @@ -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" @@ -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" { diff --git a/aws/kinesisfirehoseformetrics/versions.tf b/aws/kinesisfirehoseformetrics/versions.tf index 398beae..973b9f3 100644 --- a/aws/kinesisfirehoseformetrics/versions.tf +++ b/aws/kinesisfirehoseformetrics/versions.tf @@ -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"