Skip to content

fifo-sns-sqs-lambda-firehose-s3: Update runtime to python3.13 #2811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions fifo-sns-sqs-lambda-firehose-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Terraform template in this pattern allows you to connect an SQS FIFO queue t
* FIFO SQS queue
* FIFO SNS Topic
* Lambda function in python
* Cloudwatch log group for Lambda function
* CloudWatch log group for Lambda function
* Required roles and policies

Learn more about this pattern at Serverless Land Patterns: [serverlessland.com/patterns/sns-sqs-lambda-firehose-s3-terraform](https://serverlessland.com/patterns/sns-sqs-lambda-firehose-s3-terraform)
Expand Down Expand Up @@ -83,7 +83,7 @@ aws s3 ls "s3://fifo-sns-sqs-lambda-firehose-s3-bucket-<YOUR-DEPLOYMENT-ID>" --r
2022-03-29 19:17:01 1672 2022/03/29/17/fifo-sns-sqs-lambda-firehose-s3-stream-<YOUR-DEPLOYMENT-ID>-1-2022-03-29-17-15-58-4c161535-d7d7-4ae8-b6b9-11ee2f4cd446
```

4. You can check cloudwatch log group as well to see the lambda's event logs
4. You can check CloudWatch log group as well to see the lambda's event logs
```bash
aws logs describe-log-streams --log-group-name '/aws/lambda/fifo-sns-sqs-lambda-firehose-s3-lambda-<YOUR-DEPLOYMENT-ID>'
{
Expand Down Expand Up @@ -197,11 +197,3 @@ terraform show
----
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0








Binary file not shown.
4 changes: 2 additions & 2 deletions fifo-sns-sqs-lambda-firehose-s3/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
version = "~> 5.0"
Copy link
Contributor Author

@kakakakakku kakakakakku Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Older version does not support Python 3.13 runtime. So I updated the version to v5.

}
}

Expand Down Expand Up @@ -90,7 +90,7 @@ module "aws_lambda" {
lambda_name = "${local.prefix}-lambda-${random_id.seed.hex}"
lambda_handler = "lambdaFirehoseLogger.lambdaFirehoseLogger"
lambda_file = "./assets/lambda/lambdaFirehoseLogger.py"
lambda_runtime = "python3.8"
lambda_runtime = "python3.13"
env_variables = {
"FIREHOSE_STREAM_NAME" : "${local.prefix}-stream-${random_id.seed.hex}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ resource "aws_kinesis_firehose_delivery_stream" "stream" {


extended_s3_configuration {
role_arn = aws_iam_role.firehose_role.arn
bucket_arn = var.bucket_arn
buffer_size = var.buffer_size != null ? var.buffer_size : 1
buffer_interval = var.buffer_interval != null ? var.buffer_interval : 60
role_arn = aws_iam_role.firehose_role.arn
bucket_arn = var.bucket_arn
buffering_size = var.buffer_size != null ? var.buffer_size : 1
buffering_interval = var.buffer_interval != null ? var.buffer_interval : 60
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ resource "aws_s3_bucket" "bucket" {

}

resource "aws_s3_bucket_acl" "acl" {
bucket = aws_s3_bucket.bucket.id
acl = "private"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: The following error occurred when applying.

╷
│ Error: creating S3 Bucket (fifo-sns-sqs-lambda-firehose-s3-bucket-5b7433b3) ACL: operation error S3: PutBucketAcl, https response error StatusCode: 400, RequestID: EK11E0X70MEFY6FR, HostID: gP6Dqkaj45f3GylF7d94XhcAlriiDAFaQfNPbhgDEGaE0OulEyFHUfKHPDBLaJw+DpFQWo9+QvdjAhyJqXk+KE6Nc3ERu4p0Nc24CepIuQQ=, api error AccessControlListNotSupported: The bucket does not allow ACLs
│ 
│   with module.aws_s3_bucket.aws_s3_bucket_acl.acl,
│   on modules/terraform-aws-s3/main.tf line 16, in resource "aws_s3_bucket_acl" "acl":
│   16: resource "aws_s3_bucket_acl" "acl" {
│ 
╵

This issue is related to the changes described in the following blog post. To fix this, I deleted aws_s3_bucket_acl😀

Disabling ACLs is an S3 security best practice, and in April of 2023, we disabled ACLs by default for all new buckets.
https://aws.amazon.com/jp/blogs/storage/disabling-acls-for-existing-amazon-s3-workloads-with-information-in-s3-server-access-logs-and-aws-cloudtrail/

resource "aws_s3_bucket_public_access_block" "access" {
bucket = aws_s3_bucket.bucket.id
block_public_acls = true
Expand Down