Skip to content

fifo-sns-sqs-lambda-firehose-s3: Update runtime to python3.12 #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

Conversation

kakakakakku
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Hi😀 Thanks for the useful patterns!

To prevent future deployment issues, I updated the Lambda Python runtime version to python3.12.

While testing fifo-sns-sqs-lambda-firehose-s3, I noticed that the Lambda runtime version python3.8 was deprecated. Although it's still deployable at the moment, it will not be allowed after October 1, 2025.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

Check

terraform apply completed successfully and works good.

$ aws sns publish --topic-arn arn:aws:sns:us-east-1:000000000000:fifo-sns-sqs-lambda-firehose-s3-topic-5b7433b3.fifo --message-deduplication-id MSG-ID-1 --message-group-id MSG-GRP-1 --subject "TEST MESSAGE" --message "TESTING MESSAGE FROM CLI" --message-attributes '{"key1":{"DataType":"String","StringValue":"value1"}}' --region us-east-1
{
    "MessageId": "b5af4f54-1b5c-5c5b-979c-2e5346b6b8a3",
    "SequenceNumber": "10000000000000003000"
}

$ aws s3 ls s3://fifo-sns-sqs-lambda-firehose-s3-bucket-5b7433b3 --recursive --region us-east-1
2025-08-02 09:29:30       1672 2025/08/02/00/fifo-sns-sqs-lambda-firehose-s3-stream-5b7433b3-1-2025-08-02-00-28-29-71fe8f7e-b343-43fc-bd1a-869cf8b938b6
image

Thank you😀


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -6,7 +6,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
version = "~> 5.0"
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: Older version does not support Python 3.12 runtime. So I updated the version to v5.

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/

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants