File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ terraform {
33 required_providers {
44 aws = {
55 source = " hashicorp/aws"
6- version = " ~>4.52 .0"
6+ version = " ~> 5 .0"
77 }
88 }
99
@@ -172,12 +172,13 @@ resource "aws_lb_target_group" "target_group" {
172172resource "aws_lb_target_group_attachment" "target_group_attachment" {
173173 target_group_arn = aws_lb_target_group. target_group . arn
174174 target_id = aws_lambda_function. lambda_function . arn
175+ depends_on = [aws_lambda_permission . with_lb ]
175176}
176177
177178# Create the Lambda Function
178179resource "aws_lambda_function" "lambda_function" {
179180 function_name = " lambdaFunction"
180- runtime = " nodejs16 .x"
181+ runtime = " nodejs22 .x"
181182 handler = " index.handler"
182183 filename = " lambda.zip"
183184 role = aws_iam_role. lambda_role . arn
@@ -194,4 +195,4 @@ resource "aws_lambda_permission" "with_lb" {
194195 function_name = aws_lambda_function. lambda_function . arn
195196 principal = " elasticloadbalancing.amazonaws.com"
196197 source_arn = aws_lb_target_group. target_group . arn
197- }
198+ }
You can’t perform that action at this time.
0 commit comments