fix: resolve Lambda invocation failure from API Gateway
- Align Dockerfile with AWS official documentation for provided runtime - Remove DefinitionBody from SAM template to avoid conflict with Events property - This enables SAM to automatically generate AWS::Lambda::Permission resource - Fixes 500 error when Forgejo webhook triggers API Gateway endpoint"
This commit is contained in:
parent
a59a8e6461
commit
8cd30da394
2 changed files with 1 additions and 25 deletions
|
|
@ -13,6 +13,5 @@ FROM public.ecr.aws/lambda/provided:al2023
|
||||||
RUN dnf update -y && \
|
RUN dnf update -y && \
|
||||||
dnf install -y git zip && \
|
dnf install -y git zip && \
|
||||||
dnf clean all
|
dnf clean all
|
||||||
COPY --from=build /app/main ${LAMBDA_TASK_ROOT}
|
COPY --from=build /app/main ./main
|
||||||
WORKDIR ${LAMBDA_TASK_ROOT}
|
|
||||||
ENTRYPOINT [ "./main" ]
|
ENTRYPOINT [ "./main" ]
|
||||||
|
|
@ -105,29 +105,6 @@ Resources:
|
||||||
Name: blog-deployment-webhook-api
|
Name: blog-deployment-webhook-api
|
||||||
StageName: !Ref StageName
|
StageName: !Ref StageName
|
||||||
EndpointConfiguration: REGIONAL
|
EndpointConfiguration: REGIONAL
|
||||||
DefinitionBody:
|
|
||||||
openapi: "3.0.1"
|
|
||||||
info:
|
|
||||||
title: "Forgejo Webhook API"
|
|
||||||
version: "1.0"
|
|
||||||
paths:
|
|
||||||
/forgejo-webhook:
|
|
||||||
post:
|
|
||||||
summary: "Trigger Lambda via Forgejo Webhook"
|
|
||||||
x-amazon-apigateway-integration:
|
|
||||||
uri:
|
|
||||||
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyLambdaFunction.Arn}/invocations
|
|
||||||
httpMethod: POST
|
|
||||||
type: aws_proxy
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: "Successful response"
|
|
||||||
'400':
|
|
||||||
description: "Bad Request - Incorrect request payload format"
|
|
||||||
'401':
|
|
||||||
description: "Unauthorized - Signature verification failed"
|
|
||||||
'500':
|
|
||||||
description: "Server error - Deployment process failed"
|
|
||||||
|
|
||||||
Outputs:
|
Outputs:
|
||||||
ApiEndpoint:
|
ApiEndpoint:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue