File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
apigw-lambda-dynamodb-terraform Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change
1
+ src.zip
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
aws = {
4
4
source = " hashicorp/aws"
5
- version = " ~> 4.0 .0"
5
+ version = " ~> 5 .0"
6
6
}
7
7
random = {
8
8
source = " hashicorp/random"
@@ -56,9 +56,13 @@ resource "aws_s3_bucket" "lambda_bucket" {
56
56
force_destroy = true
57
57
}
58
58
59
- resource "aws_s3_bucket_acl " "private_bucket" {
59
+ resource "aws_s3_bucket_public_access_block " "private_bucket" {
60
60
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
62
66
}
63
67
64
68
data "archive_file" "lambda_zip" {
@@ -85,7 +89,7 @@ resource "aws_lambda_function" "apigw_lambda_ddb" {
85
89
s3_bucket = aws_s3_bucket. lambda_bucket . id
86
90
s3_key = aws_s3_object. this . key
87
91
88
- runtime = " python3.8 "
92
+ runtime = " python3.13 "
89
93
handler = " app.lambda_handler"
90
94
91
95
source_code_hash = data. archive_file . lambda_zip . output_base64sha256
@@ -222,4 +226,4 @@ resource "aws_lambda_permission" "api_gw" {
222
226
principal = " apigateway.amazonaws.com"
223
227
224
228
source_arn = " ${ aws_apigatewayv2_api . http_lambda . execution_arn } /*/*"
225
- }
229
+ }
You can’t perform that action at this time.
0 commit comments