-
Notifications
You must be signed in to change notification settings - Fork 0
Update Lambda handler path in Dockerfile and Terraform configuration #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughPreserve the Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant Build as Docker build
participant Registry as ECR / S3
participant TF as Terraform
participant Lambda as AWS Lambda
Dev->>Build: Build image (COPY `src` into /var/task/src)
Build->>Registry: Push image (Image) or upload zip (Zip)
Dev->>TF: Apply (var.lambda_package_type = Image|Zip)
TF->>Registry: Read image_uri or S3 object (conditional)
TF->>Lambda: Create/Update function with:
alt package_type == "Image"
note right of Lambda: image_uri set\nimage_config.command = ["src.event_gate_lambda.lambda_handler"]
else package_type == "Zip"
note right of Lambda: s3_bucket/key + source_code_hash\nruntime = "python3.13"\nhandler = "event_gate_lambda.lambda_handler"
end
Lambda->>Lambda: Invoke -> Python resolves imports
note right of Lambda: With Image + nested `src`, imports like `src.*` succeed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Trivy has completed a full security repository scan ✅ You can find the analysis results for this PR branch on this overview.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Dockerfile(2 hunks)terraform/lambda.tf(1 hunks)
🔇 Additional comments (2)
Dockerfile (2)
84-84: CMD directive correctly maps to lambda_handler with valid AWS Lambda signature.The handler entry point now correctly reflects the nested structure created by the updated COPY directive, allowing AWS Lambda to locate and invoke
src.event_gate_lambda.lambda_handler. The function signature atsrc/event_gate_lambda.py::lambda_handleraccepts(event: Dict[str, Any], context: Any)parameters, which is compatible with AWS Lambda expectations. This change is consistent with the Dockerfile's COPY operation and aligns with the Terraform handler configuration for container image deployments.
74-74: COPY and CMD directives verified—no issues found.The COPY directive at line 74 correctly preserves the nested src package structure, and the CMD directive at line 84 properly references the lambda_handler function at
src.event_gate_lambda.lambda_handler. The lambda_handler function exists with the correct AWS Lambda signature (event, context parameters) and src is a valid Python package with init.py. All changes align with the PR objective to resolve import errors.
|
Trivy has completed a full security repository scan ✅ You can find the analysis results for this PR branch on this overview.
|
This pull request updates the Lambda function packaging and handler configuration to improve source code organization and ensure the correct entry point is used for both ZIP and container image deployments. The changes primarily affect the Dockerfile and Terraform configuration.
Lambda packaging and handler configuration:
srcdirectory intoLAMBDA_TASK_ROOT/srcinstead of copying its contents directly, improving code organization.CMDto usesrc.event_gate_lambda.lambda_handler, reflecting the new code structure.src.event_gate_lambda.lambda_handlerfor container image deployments, while keeping the ZIP handler unchanged.Release notes:
Related:
srcpackage #85Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.