Skip to content
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
1 change: 1 addition & 0 deletions apigw-http-api-lambda-terraform/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src.zip
12 changes: 8 additions & 4 deletions apigw-http-api-lambda-terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0.0"
version = "~> 6"
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: Update AWS Provider to v6 for Python 3.14πŸ˜€

}
random = {
source = "hashicorp/random"
Expand All @@ -28,9 +28,13 @@ resource "aws_s3_bucket" "lambda_bucket" {
force_destroy = true
}

resource "aws_s3_bucket_acl" "private_bucket" {
resource "aws_s3_bucket_public_access_block" "lambda_bucket" {
bucket = aws_s3_bucket.lambda_bucket.id
acl = "private"

block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
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: Error occurred below. See blog article.

β•·
β”‚ Error: creating S3 Bucket (apigw-http-api-lambda20251213135832746300000001) ACL: operation error S3: PutBucketAcl, https response error StatusCode: 400, RequestID: F1PC1FKMGM80WSR6, HostID: rYWFaIU+gyVrqW6b+V+9IvEs17N2n6vjT5EbKq+C6oLMH6bhgyYR5SZuIc2uEYdGO4i7Ynm8jG8=, api error AccessControlListNotSupported: The bucket does not allow ACLs
β”‚ 
β”‚   with aws_s3_bucket_acl.private_bucket,
β”‚   on main.tf line 31, in resource "aws_s3_bucket_acl" "private_bucket":
β”‚   31: resource "aws_s3_bucket_acl" "private_bucket" {
β”‚ 
β•΅

}

data "archive_file" "lambda_zip" {
Expand Down Expand Up @@ -171,4 +175,4 @@ resource "aws_lambda_permission" "api_gw" {
principal = "apigateway.amazonaws.com"

source_arn = "${aws_apigatewayv2_api.lambda.execution_arn}/*/*"
}
}