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
Binary file added apigw-http-eventbridge-terraform/LambdaFunction.zip
Binary file not shown.
10 changes: 5 additions & 5 deletions apigw-http-eventbridge-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 = "~> 3.27"
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πŸ˜€

}
}

Expand Down Expand Up @@ -54,7 +54,7 @@ resource "aws_iam_policy" "APIGWPolicy" {
"Action" : [
"events:PutEvents"
],
"Resource" : "arn:aws:events:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:event-bus/default"
"Resource" : "arn:aws:events:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:event-bus/default"
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: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region

name - (Optional, Deprecated) Full name of the region to select. Use region instead.

β•·
β”‚ Warning: Deprecated attribute
β”‚ 
β”‚   on main.tf line 57, in resource "aws_iam_policy" "APIGWPolicy":
β”‚   57:       "Resource" : "arn:aws:events:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:event-bus/default"
β”‚ 
β”‚ The attribute "name" is deprecated. Refer to the provider documentation for details.
β”‚ 
β”‚ (and 2 more similar warnings elsewhere)

}
]
}
Expand Down Expand Up @@ -97,7 +97,7 @@ resource "aws_iam_policy" "LambdaPolicy" {
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource" : "arn:aws:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:log-group:/aws/lambda/${aws_lambda_function.MyLambdaFunction.function_name}:*:*"
"Resource" : "arn:aws:logs:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:log-group:/aws/lambda/${aws_lambda_function.MyLambdaFunction.function_name}:*:*"
}
]
}
Expand Down Expand Up @@ -183,7 +183,7 @@ resource "aws_lambda_function" "MyLambdaFunction" {
role = aws_iam_role.LambdaRole.arn
handler = "LambdaFunction.lambda_handler"
runtime = "python3.14"
layers = ["arn:aws:lambda:${data.aws_region.current.name}:017000801446:layer:AWSLambdaPowertoolsPython:15"]
layers = ["arn:aws:lambda:${data.aws_region.current.region}:017000801446:layer:AWSLambdaPowertoolsPython:15"]
}

# Allow the EventBridge rule created to invoke the Lambda function
Expand All @@ -208,4 +208,4 @@ output "LambdaFunctionName" {
output "CloudWatchLogName" {
value = "/aws/lambda/${aws_lambda_function.MyLambdaFunction.function_name}"
description = "The Lambda Function Log Group"
}
}