Skip to content

Commit 78941aa

Browse files
fix api gateway route target, recipient env var, SES ToAddresses
1 parent 23b499c commit 78941aa

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎infrastructure/api_gateway.tf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ resource "aws_lambda_permission" "api_gateway" {
3434
resource "aws_apigatewayv2_route" "contact" {
3535
api_id = aws_apigatewayv2_api.portfolio.id
3636
route_key = "POST /api/contact"
37-
target = "integration/${aws_apigatewayv2_integration.contact.id}"
37+
target = "integrations/${aws_apigatewayv2_integration.contact.id}"
3838

3939
depends_on = [aws_apigatewayv2_integration.contact]
4040
}

‎infrastructure/lambda.tf‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ data "archive_file" "lambda_placeholder" {
33
output_path = "${path.module}/lambda_placeholder.zip"
44

55
source {
6-
content = "def handler(event, contact): return {'statusCode': 200, 'body': 'placeholder'}"
6+
content = "def handler(event, context): return {'statusCode': 200, 'body': 'placeholder'}"
77
filename = "handler.py"
88
}
99
}
@@ -18,8 +18,8 @@ resource "aws_lambda_function" "contact" {
1818

1919
environment {
2020
variables = {
21-
SENDER_EMAIL = var.sender_email
22-
RECIPENT_EMAIL = var.recipient_email
21+
SENDER_EMAIL = var.sender_email
22+
RECIPIENT_EMAIL = var.recipient_email
2323
}
2424
}
2525

‎lambda/handler.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def handler(event, context):
2828
ses.send_email(
2929
Source=sender,
3030
Destination={
31-
'ToAddress': [reciepient]
31+
'ToAddresses': [reciepient]
3232
},
3333
Message={
3434
'Subject': {

0 commit comments

Comments
 (0)