Skip to content

Commit 9d31f9d

Browse files
authored
Merge pull request #2799 from kakakakakku/apigw-lambda-dynamodb-terraform
apigw-lambda-dynamodb-terraform: Update runtime to python3.13
2 parents d8028b0 + 3437871 commit 9d31f9d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src.zip

apigw-lambda-dynamodb-terraform/main.tf

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "~> 4.0.0"
5+
version = "~> 5.0"
66
}
77
random = {
88
source = "hashicorp/random"
@@ -56,9 +56,13 @@ resource "aws_s3_bucket" "lambda_bucket" {
5656
force_destroy = true
5757
}
5858

59-
resource "aws_s3_bucket_acl" "private_bucket" {
59+
resource "aws_s3_bucket_public_access_block" "private_bucket" {
6060
bucket = aws_s3_bucket.lambda_bucket.id
61-
acl = "private"
61+
62+
block_public_acls = true
63+
block_public_policy = true
64+
ignore_public_acls = true
65+
restrict_public_buckets = true
6266
}
6367

6468
data "archive_file" "lambda_zip" {
@@ -85,7 +89,7 @@ resource "aws_lambda_function" "apigw_lambda_ddb" {
8589
s3_bucket = aws_s3_bucket.lambda_bucket.id
8690
s3_key = aws_s3_object.this.key
8791

88-
runtime = "python3.8"
92+
runtime = "python3.13"
8993
handler = "app.lambda_handler"
9094

9195
source_code_hash = data.archive_file.lambda_zip.output_base64sha256
@@ -222,4 +226,4 @@ resource "aws_lambda_permission" "api_gw" {
222226
principal = "apigateway.amazonaws.com"
223227

224228
source_arn = "${aws_apigatewayv2_api.http_lambda.execution_arn}/*/*"
225-
}
229+
}

0 commit comments

Comments
 (0)